{"trustable":false,"sections":[{"title":"","value":{"format":"PLAIN","content":"Ancient Roman empire had a strong government system with various departments, including a secretservice department. Important documents were sent between provinces and the capital in encrypted form to prevent eavesdropping. The most popular ciphers in those times were so called substitution cipher and permutation cipher.\n\nSubstitution cipher changes all occurrences of each letter to some other letter. Substitutes for allletters must be different. For some letters substitute letter may coincide with the original letter. For example, applying substitution cipher that changes all letters from `A\u0027 to `Y\u0027 to the next ones in the alphabet, and changes `Z\u0027 to `A\u0027, to the message \\VICTORIOUS\" one gets the message \\WJDUPSJPVT\".Permutation cipher applies some permutation to the letters of the message. For example, applying the permutation⟨2;1;5;4;3;7;6;10;9;8⟩to the message \\VICTORIOUS\" one gets the message\\IVOTCIRSUO\".\n\nIt was quickly noticed that being applied separately, both substitution cipher and permutation cipher were rather weak. But when being combined, they were strong enough for those times. Thus,the most important messages were first encrypted using substitution cipher, and then the result was encrypted using permutation cipher. Encrypting the message \\VICTORIOUS\" with the combination of the ciphers described above one gets the message \\JWPUDJSTVP\".\n\nArcheologists have recently found the message engraved on a stone plate. At the first glance itseemed completely meaningless, so it was suggested that the message was encrypted with some substitution and permutation ciphers. They have conjectured the possible text of the original message thatwas encrypted, and now they want to check their conjecture. They need a computer program to do it,so you have to write one.\n\nInput\n\nInput file contains several test cases. Each of them consists of two lines. The first line contains the message engraved on the plate. Before encrypting, all spaces and punctuation marks were removed, so the encrypted message contains only capital letters of the English alphabet. The second line containsthe original message that is conjectured to be encrypted in the message on the first line. It also containsonly capital letters of the English alphabet.The lengths of both lines of the input file are equal and do not exceed 100.\n\nOutput\n\nFor each test case, print one output line. Output `YES\u0027 if the message on the first line of the input file could be the result of encrypting the message on the second line, or `NO\u0027 in the other case.\n\nSample Input\n\nJWPUDJSTVP\nVICTORIOUS\nMAMA\nROME\nHAHA\nHEHE\nAAA\nAAA\nNEERCISTHEBEST\nSECRETMESSAGES\n\nSample Output\n\nYES\nNO\nYES\nYES\nNO\n\n古罗马帝国有一个强大的政府系统,有各种部门,包括保密部门。为了防止窃听,各省和首都之间的重要文件都是以加密的形式发送的。当时最流行的密码是所谓的替换密码和换位密码。\n\n替换密码是将每个字母的所有出现都改为其他字母。所有字母的替代字母必须是不同的。对于某些字母,替代字母可能与原始字母重合。例如,应用替换密码将所有字母从`A\u0027到`Y\u0027改变为字母表中的下一个字母,并将`Z\u0027改变为`A\u0027,得到的信息是\"/WJDUPSJPVT\"。 例如,将排列组合⟨2;1;5;4;3;7;6;10;9;8⟩应用于信息\"/VICTORIOUS\",就会得到信息\"/IVOTCIRSUO\"。\n\n人们很快就发现,单独应用时,替换密码和换元密码都比较弱。但是当它们结合起来的时候,在那个时代已经足够强大了。因此,最重要的信息先用替换密码进行加密,然后用换元密码对结果进行加密。用上述密码的组合对信息 \"ICTORIOUS \"进行加密,可以得到信息 \"JWPUDJSTVP\"。\n\n考古学家最近发现了刻在石板上的信息。乍一看,它似乎完全没有意义,所以有人认为这条信息是用一些替换和换元密码加密的。他们已经猜测出被加密的原始信息的可能文本,现在他们想检查他们的猜测。他们需要一个计算机程序来完成,所以你必须写一个程序。\n\n输入内容\n\n输入文件包含几个测试用例。每个测试案例都由两行组成。第一行包含刻在盘子上的信息,在加密之前,所有的空格和标点符号都被去掉,加密后的信息只包含英文字母的大写字母。在加密之前,所有的空格和标点符号都被去掉了,所以加密后的信息只包含英文字母的大写字母。第二行包含了第一行信息中被猜测加密的原始信息,也只包含了英文字母的大写字母。输入文件的两行长度相等,不超过100。\n\n输入文件的两行长度相等且不超过100。\n\n对于每个测试案例,打印一行输出。如果输入文件第一行的信息可能是加密第二行信息的结果,则输出 \"YES\",如果是其他情况,则输出 \"NO\"。\n\n输入示例\n\nJWPUDJSTVP\nVICTORIOUS\nMAMA\n罗马\nHAHA\nHEHE\nAAA\nAAA\nNEERCISTHEBEST\n秘密信息(SecretMessages)\n\n采样输出\n\n是\n没有\n是\n是\n没有\n\n"}}]}