program AAA;
{$APPTYPE CONSOLE}
uses
  SysUtils;

const _NAME='ancient';
var orig, code: String;
    s1, s2: string;
    m1,m2: array[1..26] of Integer;
    j, p, i: Integer;
    fl: Boolean;

procedure Input;
var F: Text;
begin
  Assign(F, _NAME+'.in');
  Reset(F);
  ReadLn(F, code);
  ReadLn(F, orig);
  Close(F);
end; // Input

procedure Output;
var F: Text;
begin
  Assign(F, _NAME+'.out');
  ReWrite(F);
  if fl then WriteLn(F, 'YES') else WriteLn(F, 'NO');
  Close(F);
end; // Output


begin
  Input;
  s1:=''; s2:='';
  for i:=1 to Length(code) do begin
    p:=Pos(code[i], s1);
    if p=0 then begin
      s1:=s1+code[i];
      p:=Length(s1);
    end;
    m1[p]:=m1[p]+1;
  end;

  for i:=1 to Length(orig) do begin
    p:=Pos(orig[i], s2);
    if p=0 then begin
      s2:=s2+orig[i];
      p:=Length(s2);
    end;

    m2[p]:=m2[p]+1;
  end;

  for i:=1 to Length(s1) do begin
    fl:=False;
    for j:=1 to length(s2) do begin
      if m1[i]=m2[j] then begin
        m2[j]:=-1;
        fl:=True;
        Break;
      end;
    end;
    if fl=False then Break;
  end;


  Output;




end.
