uses
  SysUtils;
var
  i: integer;
  a, b: array['A' .. 'Z'] of integer;
  s1, s2: string;
  c, cc: char;
  f, ff: boolean;
begin
  assignfile(input, 'ancient.in');
  assignfile(output, 'ancient.out');
  reset(input);
  rewrite(output);
  readln(s1);
  readln(s2);
  fillchar(a, sizeof(a), 0);
  fillchar(b, sizeof(b), 0);
  for i := 1 to Length(s1) do
    Inc(a[s1[i]]);
  for i := 1 to Length(s2) do
    Inc(b[s2[i]]);
  f := True;
  for c := 'A' to 'Z' do
  begin
    if a[c] <> 0 then
    begin
      ff := False;
      for cc := 'A' to 'Z' do
      begin
        if a[c] = b[cc] then
        begin
          a[c] := 0;
          b[cc] := 0;
          ff := True;
          break;
        end;
      end;
      if not ff then
      begin
        f := False;
        break;
      end;
    end;
  end;
  if f then
    Write('YES')
  else
    write('NO');
  closefile(input);
  closefile(output);
end.
