问题 5188 --Amusing Joke(有趣的笑话)

5188: Amusing Joke(有趣的笑话)★★

时间限制: 2 Sec  内存限制: 256 MB
提交: 21  解决: 17
[提交][状态][命题人:]

题目描述

So, the New Year holidays are over. Santa Claus and his colleagues can take a rest and have guests at last. When two "New Year and Christmas Men" meet, thear assistants cut out of cardboard the letters from the guest's name and the host's name in honor of this event.

 Then the hung the letters above the main entrance. One night, when everyone went to bed, someone took all the letters of our characters' names. Then he may have shuffled the letters and put them in one pile in front of the door.

所以,新年假期结束了。圣诞老人和他的同事们终于可以休息一下和迎接客人了。当两个“新年人”和“圣诞人”相遇时,助手会用纸板剪下客人和主人的名字,以示庆祝。然后他们把这些字母挂在正门的上方。一天晚上,当所有人都上床睡觉时,有人拿走了我们角色名字的所有字母。然后,他可能把字母洗刷了一遍,把它们在门前放成一堆。

The next morning it was impossible to find the culprit who had made the disorder. But everybody wondered whether it is possible to restore the names of the host and his guests from the letters lying at the door? That is, we need to verify that there are no extra letters, and that nobody will need to cut more letters.

第二天早上,已经找不到制造混乱的罪魁祸首了。但每个人都想知道,是否有可能从门上的字母中恢复主人和客人的姓名?也就是说,我们需要验证没有额外的字母,并且没有人需要删除多余的字母。

Help the "New Year and Christmas Men" and their friends to cope with this problem. You are given both inscriptions that hung over the front door the previous night, and a pile of letters that were found at the front door next morning.

帮助“新年和圣诞人”和他们的朋友解决这个问题。你得到了前一晚挂在前门上的铭文和第二天早上在前门发现的一堆字母。

输入

The input file consists of three lines: the first line contains the guest's name, the second line contains the name of the residence host and the third line contains letters in a pile that were found at the door in the morning. All lines are not empty and contain only uppercase Latin letters. The length of each line does not exceed 100.

输入文件由三行组成:第一行包含客人的姓名,第二行包含住所主人的姓名,第三行包含早上在门口发现的一堆字母。所有的行都不是空的,只包含大写的拉丁字母。每一行的长度不超过100

输出

Print "YES" without the quotes, if the letters in the pile could be permuted to make the names of the "New Year and Christmas Men". Otherwise, print "NO" without the quotes.

如果这堆字母可以排列成“新年人”和“圣诞人”的名字,打印“YES”而不带引号。否则,打印不带引号的“NO”。

样例输入
Copy
输入1:
SANTACLAUS
DEDMOROZ
SANTAMOROZDEDCLAUS
输入2:
A
B
BA
输入3:
AAB
B
AAB
样例输出
Copy
输出1:
YES
输出2:
YES
输出3:
NO

提示

In the first sample and the second sample, the letters written in the last line can be used to write the names and there won't be any extra letters left.

在第一个例子中,写在最后一行的字母可以用来写名字,不会有任何额外的字母剩下。

In the second sample letter "P" is missing from the pile and there's an extra letter "L".

在第二个样本中,字母“P”从一堆中消失了,多了一个字母“L”。

In the third sample there's an extra letter "B".

在第三个例子中,多了一个字母 "B".

来源

[提交][状态]