program ProblemA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
f,f1:textfile;
s:string[26];
s1,s2:String[100];
i,j,k:integer;
b:boolean;
begin
Assign(f,'ancient.in');
Assign(f1,'ancient.out');
reset(f);
rewrite(f1);
read(f,s1);
readln(f);
read(f,s2);
writeln(s1);
writeln(s2);
for i:=1 to length(s1) do
begin
if s[i]='A' then
s[i]:='Z'
else
begin
s1[i]:=chr(pred(ord(s1[i])));
end;
end;
j:=0;
for i:=1 to length(s1) do
begin
b:=true;
for k:=1 to length(s2) do
begin
if (s1[i]=s2[k]) and (b) then
begin
s2[k]:='@';
j:=j+1;
b:=false;
end;
end;
end;
if (j=length(s1)) and (j=length(s2)) then
write(f1,'YES')
else
write(f1,'NO');
close(f);
close(f1);
end.
