program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
a:array [1..27] of longint;
b:array [1..27] of longint;
u:array [1..27] of boolean;

s,I,t,p:longint;
f,f1:text;
st:string;
q:boolean;
begin
assign(f,'ancient.in');
assign(f1,'ancient.out');
reset(f);
rewrite(f1);
for t:=1 to 27 do a[t]:=0;
for t:=1 to 27 do b[t]:=0;
for t:=1 to 27 do u[t]:=true;

readln(f,st);
for t:=1 to length(st) do inc(a[ord(st[t])-ord('A')+1]);
readln(f,st);
for t:=1 to length(st) do inc(b[ord(st[t])-ord('A')+1]);

for t:=1 to 27 do begin
q:=true;
p:=1;
while q and (p<=27) do begin
if u[p] and (a[t]=b[p]) then begin
u[p]:=false;
q:=false;
end;
inc(p);
end;
if q then begin
write(f1,'NO');
close(f);
close(f1);
halt(0);
end;


end;




write(f1,'YES');
close(f);
close(f1);


  { TODO -oUser -cConsole Main : Insert code here }
end.
