300743: CF141A. Amusing Joke

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Amusing Joke

题意翻译

给出三个字符串,问能否将第三个字符串中的每个字符剪下来,重新拼接,形成前两个字符串,并且不需 要添加额外的字符,所有字符恰好用光,没有剩余。输出 YES 或 NO。

题目描述

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 $ .

输出格式


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.

输入输出样例

输入样例 #1

SANTACLAUS
DEDMOROZ
SANTAMOROZDEDCLAUS

输出样例 #1

YES

输入样例 #2

PAPAINOEL
JOULUPUKKI
JOULNAPAOILELUPUKKI

输出样例 #2

NO

输入样例 #3

BABBONATALE
FATHERCHRISTMAS
BABCHRISTMASBONATALLEFATHER

输出样例 #3

NO

说明

In the first 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". In the third sample there's an extra letter "L".

Input

题意翻译

给出三个字符串,问能否将第三个字符串中的每个字符剪下来,重新拼接,形成前两个字符串,并且不需 要添加额外的字符,所有字符恰好用光,没有剩余。输出 YES 或 NO。

加入题单

上一题 下一题 算法标签: