{$apptype console}

program ancient;

const
                infile='ancient.in';
                outfile='ancient.out';
                maxn=100;

type
                int=longint;

var
        a,b             :array ['A'..'Z'] of int;
        c,d             :array ['A'..'Z'] of boolean;
        n,m             :int;
        can             :boolean;
        i,j             :char;

procedure load;
var
        ch:char;
begin
  assign(input,infile);
  reset(input);
  fillchar(a,sizeof(a),0);
  fillchar(b,sizeof(b),0);
  n:=0;
  while not seekeoln(input) do begin
    read(ch);
    if ch in ['A'..'Z'] then begin
      inc(n);
      inc(a[ch]);
     end;
   end;
  readln;
  m:=0;
  while not seekeoln(input) do begin
    read(ch);
    if ch in ['A'..'Z'] then begin
      inc(m);
      inc(b[ch]);
     end;
   end;
  close(input);
end;

procedure solve;
var
        top,sum:int;
begin
  fillchar(c,sizeof(c),false);
  fillchar(d,sizeof(d),false);
  for i:='A'  to 'Z' do if a[i]<>0 then
    for j:='A' to 'Z' do if(b[j]<>0)and(not c[j])and(a[i]=b[j])then begin
      c[j]:=true;
      d[i]:=true;
      break;
     end;
   can:=true;
  for i:='A' to 'Z' do
   if(b[i]<>0)and(not c[i]) then can:=false;
end;

procedure print;
begin
  assign(output,outfile);
  rewrite(output);
  if can then writeln('YES')
        else writeln('NO');
  close(output);
end;

begin
  load;
  solve;
  print;
end.
