{$apptype console}
{$I+,R+,Q+}
Uses Sysutils;
Var
  s1,s2,s3:string;
  i:integer;
Begin
  readln(s1);
  readln(s2);
  readln(s3);
  for i:=1 to length(s1) do begin
    if pos(s1[i],s3)<>0 then delete(s3,pos(s1[i],s3),1)
    else begin
      writeln('NO');
      halt;
    end;
  end;
  for i:=1 to length(s2) do begin
    if pos(s2[i],s3)<>0 then delete(s3,pos(s2[i],s3),1)
    else begin
      writeln('NO');
      halt;
    end;
  end;
  if s3='' then writeln('YES')
  else writeln('NO');
End.

program problem;

var i:integer;
 c1,c2,c3:array['A'..'Z'] of integer;
 ch:char;
 name1,name2,pile:string;

begin
readln(name1);
readln(name2);
readln(pile);

for i:=1 to length(name1) do begin
c1[name1[i]]:=c1[name1[i]]+1;
//writeln(c1[name1[i]]);
end;
//writeln('===');
for i:=1 to length(name2) do begin
c2[name2[i]]:=c2[name2[i]]+1;
//writeln(c2[name2[i]]);
end;
//writeln('===');
for i:=1 to length(pile) do begin
c3[pile[i]]:=c3[pile[i]]+1;
//writeln(c3[pile[i]]);
end;

for ch:='A' to 'Z' do
//writeln(ch,' ',c1[ch],' ',c2[ch],' ',c3[ch]);
if (c1[ch]+c2[ch]<>c3[ch]) then begin
write('NO');
halt;
end;
write('YES');

end.

program ferst;
var
  d1,d2,b:string;
  n,i:integer;
begin
  readln(d1);
  readln(d2);
  d1:=d1+d2;
  readln(b);
  for i:=1 to length(d1) do
    if pos(d1[i],b)<>0 then delete(b,pos(d1[i],b),1)
                       else begin write('NO');halt; end;

  if length(b)=0 then write('YES') else write('NO');
end.

program ferst;
var
  d1,d2,b:string;
  n,i:integer;
begin
  readln(d1);
  readln(d2);
  readln(b);
  for i:=1 to length(d1) do
    if pos(d1[i],b)<>0 then delete(b,pos(d1[i],b),1)
                       else begin write('NO');halt; end;

 for i:=1 to length(d2) do
    if pos(d2[i],b)<>0 then delete(b,pos(d2[i],b),1)
                       else begin write('NO');halt; end;

  if length(b)=0 then write('YES') else write('NO');
end.

 var a,b,c:string;i:integer;  G:array[1..256]of integer;
begin
readln(a);
readln(b);
readln(c);

for i:=1 to length(a) do
inc(g[ord(a[i])]);
for i:=1 to length(b) do
inc(g[ord(B[i])]);
for i:=1 to length(C) do
DEC(g[ord(C[i])]);
for i:=1 to 256 do
if g[i]<>0 then BEGIN write('NO'); exit;END;
 write('YES')
end.

var
    s1, s2, st: string;
    i: byte;
begin
    readln(s1);
    readln(s2);
    readln(st);
    if length(s1 + s2) <> length(st) then
    	begin
    		write('NO');
    		exit;
    	end;
    for i:=1 to length(s1) do
    	if pos(s1[i],st) <> 0 then
    		delete(st,pos(s1[i],st),1);
    for i:=1 to length(s2) do
    	if pos(s2[i],st) <> 0 then
    		delete(st,pos(s2[i],st),1);
    if st = '' then write('YES') else write('NO');
end.

const
        fi='';
        fo='';
var
        f,f1:text;
        s,s1,s2:string;
        i,err:integer;
        check:array[1..255] of boolean;
        count,count1:array[1..255] of integer;
begin
        assign(f,fi);reset(f);
        assign(f1,fo);rewrite(f1);
        readln(f,s);
        readln(f,s1);
        readln(f,s2);
        fillchar(check,sizeof(check),false);
        fillchar(count,sizeof(count),0);
        fillchar(count1,sizeof(count1),0);
        err:=0;
        for i:=1 to length(s) do
        begin
                if(not check[ord(s[i])]) then begin
                        check[ord(s[i])]:=true;
                end;
                inc(count[ord(s[i])]);
        end;
        for i:=1 to length(s1) do
        begin
                if(not check[ord(s1[i])]) then begin
                        check[ord(s1[i])]:=true;
                end;
                inc(count[ord(s1[i])]);
        end;
        for i:=1 to length(s2) do
        begin
                if(not check[ord(s2[i])]) then begin
                        writeln(f1,'NO');
                        inc(err);
                        break;
                end else inc(count1[ord(s2[i])]);
        end;
      {  for i:=1 to 255 do
        begin
                if(count[i]<>0) then writeln(f1,'Chr[',i,']=',count[i]);
                if(count1[i]<>0) then writeln(f1,'Chr1[',i,']=',count1[i]);
        end;  }
        for i:=1 to 255 do
        begin
                if(count[i]<>count1[i]) and(err=0) then begin
                        writeln(f1,'NO');
                        inc(err);
                        break;
                end;
        end;
        if(err=0) then writeln(f1,'YES');
        close(f);
        close(f1);
end.

program z;
var bufstr:string;
mas:array['A'..'Z'] of integer;
a:char;
i:integer;
begin
readln(bufstr);
        for i:=length(bufstr) downto 1 do
        begin
        inc(mas[bufstr[i]]);
        end;
readln(bufstr);
        for i:=length(bufstr) downto 1 do
        begin
        inc(mas[bufstr[i]]);
        end;
readln(bufstr);
        for i:=length(bufstr) downto 1 do
        begin
        dec(mas[bufstr[i]]);
        end;
        for a:='A' to 'Z' do
        begin
                if (mas[a]<0) or (mas[a]>0) then
                begin
                write('NO');
                exit;
                end;
        end;
        write('YES');
end.

var
  a,s,d,f:integer;
  z,x,c,M:string;
begin
  readln(z);
  readln(x);
  readln(c);
  M:=C;
  for a:=1 to length(z) do
  BEGIN
  for s:=1 to length(c) do
  if(z[a]=c[s]) then begin delete(c,S,1); break; end;
  end;
  for a:=1 to length(x) do
  BEGIN
  for s:=1 to length(c) do
  if (x[a]=c[s]) then begin delete (C,S,1); break; end;
  end;
  if(length(c)=0) AND (LENGTH(X)+LENGTH(Z)=LENGTH(M)) then writeln('YES') else writeln('NO');
  READLN();
  READLN();
end.

var
    a:array[1..26] of longint;
    b:array[1..26] of longint;
    s1,s2,s3:string;
    i,dk:longint;
begin
    readln(s1); readln(s2); readln(s3);
    for i:=1 to length(s1) do inc(a[ord(s1[i])-64]);
    for i:=1 to length(s2) do inc(a[ord(s2[i])-64]);
    for i:=1 to length(s3) do inc(b[ord(s3[i])-64]);
    for i:=1 to 26 do
        if a[i]<>b[i] then dk:=1;
    if dk=1 then write('NO') else write('YES');
end.

const fi=''; fo='';
procedure process;
var f,g:text; i:integer; s1,s2,s3:string; k:char; d:boolean;
    a,b:array['A'..'Z']of integer;
begin
    assign(f,fi); reset(f); assign(g,fo); rewrite(g);
    fillchar(a,sizeof(a),0);
    fillchar(b,sizeof(b),0);
    readln(f,s1); readln(f,s2); readln(f,s3);
    for i:=1 to length(s1) do inc(a[s1[i]]);
    for i:=1 to length(s2) do inc(a[s2[i]]);
    for i:=1 to length(s3) do inc(b[s3[i]]);
    d:=true;
    for k:='A' to 'Z' do if a[k]<>b[k] then begin d:=false; break; end;
    if d then write(g,'YES') else write(g,'NO');
    close(f); close(g);
end;
begin process; end.

var
 s:string;
 i,f:longint;
 x:char;
 a:array['A'..'Z']of longint;

begin
  Readln(s);
  for i:=1 to length(s) do
   Inc(a[s[i]]);
  Readln(s);
  for i:=1 to length(s) do
   Inc(a[s[i]]);
  Readln(s);

  for i:=1 to length(s) do
   Dec(a[s[i]]);
  f:=0;
  for x:='A' to 'Z' do
   if a[x] <> 0 then f:=-1;
  if f = 0 then write('YES')
           else write('NO');
end.

program q;
var s, c, v : string;
i, y : integer;
a, b : array [1..100] of char;
x : char;
l : boolean;
begin
    readln(s);
    readln(c);
    readln(v);
    s := s + c;
    if length(s) = length(v) then
    begin
        for i := 1 to length(s) do
        begin
            a[i] := s[i];
            b[i] := v[i];
        end;
        for i := 1 to length(s) do
        begin
            for y := 1 to length(s) - 1 do
            begin
                if ord(a[y]) > ord(a[y + 1]) then
                begin
                    x := a[y];
                    a[y] := a[y + 1];
                    a[y + 1] := x;
                end;
                if ord(b[y]) > ord(b[y + 1]) then
                begin
                    x := b[y];
                    b[y] := b[y + 1];
                    b[y + 1] := x;
                end;
            end;
        end;
        for i := 1 to length(s) do
        begin
            if a[i] <> b[i] then l := true;
        end;
        if l then write('NO')
        else write('YES');
    end
    else write('NO');
end.

var
f1:text;
s,s1,s2,s3:string;
i,j:longint;
x1,x:char;
bol:boolean;
begin
bol:=true;
readln(s);
readln(s1);
readln(s2);
if length(s)+length(s1)=length(s2) then begin
    s3:=s+s1;
    for i:=1 to length(s3)-1 do
    for j:=i+1 to length(s3) do
    if s3[i]>s3[j] then begin
    x:=s3[i];
    s3[i]:=s3[j];
    s3[j]:=x;
    end;

    for i:=1 to length(s3)-1 do
    for j:=i+1 to length(s3) do
    if s2[i]>s2[j] then begin
    x1:=s2[i];
    s2[i]:=s2[j];
    s2[j]:=x1;
    end;

    for i:=1 to length(s3) do if s3[i]<>s2[i] then begin
    bol:=false;
    break;
    end;
    if bol then writeln('YES')
    else
    writeln('NO');

end
else
writeln('NO');
end.

var
s:string;
i:longint;
bol:boolean;
a:array[-100..1000]of longint;
begin
readln(s);
for i:=1 to length(s) do inc(a[ord(s[i])]);
readln(s);
for i:=1 to length(s) do inc(a[ord(s[i])]);
readln(s);
for i:=1 to length(s) do dec(a[ord(s[i])]);
for i:=-100 to 1000 do begin
    if a[i]<>0 then bol:=true;
end;
if bol then writeln('NO')
else
writeln('YES');
end.

var     s1,s2,s:string;
        i:longint;
        a1,a2:array[1..100] of longint;
begin
        readln(s1);
        readln(s2);
        readln(s);
        s1:=s1+s2;
        for i:=1 to length(s1) do
                a1[ord(s1[i])]:= a1[ord(s1[i])]+1;
        for i:=1 to length(s) do
                a2[ord(s[i])]:= a2[ord(s[i])]+1;
        for i:= 65 to 90 do
                if a1[i] <> a2[i] then
                        begin
                                write('NO');
                                exit;
                        end;
        write('YES');
end.

var
 a,b,c,s:ansistring;
 x,y:array[0..128] of longint;
 i:longint;
begin
 readln(a);
 readln(b);
 readln(c);
 s:=a+b;
 if length(s)<>length(c) then
  begin
   writeln('NO');
   halt;
  end;
 for i:=1 to length(s) do
  begin
   inc(x[ord(s[i])]);
   inc(y[ord(c[i])]);
  end;
 for i:=1 to 128 do
  if x[i]<>y[i] then
   begin
    writeln('NO');
    halt;
   end;
 writeln('YES');
end.

var
    a,b,c,temp: string; n,i : integer;

begin
    readln(a); readln(b); readln(c);
    insert(a,b,1); n := length(b);
    if (n <> length(c)) then writeln('NO')
    else begin
        for i:=1 to n do
        begin
            temp := b;
            delete(temp,1,i-1); delete(temp,2,n-i);
            delete(c,pos(temp,c),1);
        end;
        if(c = '') then writeln('YES')
        else writeln('NO');
    end;
end.

var a,b,c:string;
    d:array[1..10000] of integer;
    i:integer;
    t:boolean;
begin
readln (a);
readln (b);
read (c);
if length(b)+length(a)=length(c) then
begin
for i:=1 to length (a) do
inc(d[ord(a[i])]);

for i:= 1 to length(b) do
inc(d[ord(b[i])]);

for i:=1 to length (c) do
if d[ord(c[i])]<=0 then begin t:=true; break; end else (dec(d[ord(c[i])]));

if (t=false) then writeln('YES') else writeln('NO');
end else writeln('NO');

end.

var
  s, s1, s2, s3 : string;
  count : longint;
begin
  count := 0;
  readln(s);
  readln(s1);
  readln(s2);
  s2 := s2 + ' ';
  s3 := s + s1;
  if length(s2) <> length(s3) + 1 then writeln('NO') else begin
    while s2 <> ' ' do begin
      if pos(s2[1],s3) <> 0 then begin count := count + 1; delete(s3,pos(s2[1],s3),1); delete(s2,1,1); end else break;
    end;
    if count = length(s) + length(s1) then writeln('YES') else writeln('NO');
  end;
end.

const   f1='141a.inp';
        f2='141a.out';
var     a,b:string;
        j,d,i:longint;

 begin
        // assign(input,f1);reset(input);
        //assign(output,f2);rewrite(output);

        readln(a);
        readln(b);
        a:=a+b;
        readln(b);

        for i:=1 to length(a) do
        begin
                if pos(a[i],b)<>0 then
                        delete(b,pos(a[i],b),1) else inc(d)

        end;

        if (b='') and (d=0) then writeln('YES') else writeln('NO');

end.

type
 mas = array [1..26] of longint;

 var
  i:longint;
  s1,s2,full,aph:string;
  bckvid,prov:mas;
  check:boolean;
  begin
   aph:='QWERTYUIOPASDFGHJKLZXCVBNM';
   readln(s1);
   readln(s2);
   readln(full);
   for i:=1 to 26 do
    begin
      bckvid[i]:=0;
      prov[i]:=0;
    end;
   for i:=1 to length(s1) do
    begin
    bckvid[pos(copy(s1,i,1),aph)]+=1;
    end;
   for i:=1 to length(s2) do
    begin
    bckvid[pos(copy(s2,i,1),aph)]+=1;
    end;

   for i:=1 to length(full) do
    begin
     prov[pos(copy(full,i,1),aph)]+=1;
    end;

   check:=true;
   for i:=1 to 26 do
    if prov[i]<>bckvid[i] then
     check:=false;

   if check then
    writeln('YES')
   else
    writeln('NO');
  end.

var i,j,k,l,n:integer;
    a,b:array [1..500] of integer;
    ch:char;
begin
while not eoln do begin
read(ch);
a[ord(ch)-64]:=a[ord(ch)-64]+1;
end;
readln;
while not eoln do begin
read(ch);
a[ord(ch)-64]:=a[ord(ch)-64]+1;
end;
readln;
while not eoln do begin
read(ch);
b[ord(ch)-64]:=b[ord(ch)-64]+1;
end;
for i:= 1 to 50 do
if a[i]<>b[i] then begin write('NO'); exit; end;
write('YES');
end.

var i:integer;
a, b, c, ans:string;
d, e:array[1..26] of integer;
begin
	for i := 1 to 26 do begin
		d[i] := 0;
		e[i] := 0;
	end;
	ans := 'YES';
	readln(a);
	readln(b);
	readln(c);
	a := a + b;
	for i := 1 to length(a) do
		inc(d[ord(a[i]) - 64]);
	for i := 1 to length(c) do
		inc(e[ord(c[i]) - 64]);
	for i := 1 to 26 do
	if (d[i] <> e[i]) then ans := 'NO';
	writeln(ans);
end.

Var s,t,ans:ansistring;
    a:array[0..200] of longint;
    i:longint;
   begin
    readln(s);
    for i:=1 to length(s) do inc(a[ord(s[i])]);
    readln(s);
    for i:=1 to length(s) do a[ord(s[i])]:=a[ord(s[i])]+1;
    readln(s);
    for i:=1 to length(s) do a[ord(s[i])]:=a[ord(s[i])]-1;
    ans:='YES';
    for i:=1 to 200 do
       if a[i]<>0 then
         begin
          ans:='NO';
          break;
         end;
    writeln(ans);
   end.

{$A8,B-,C+,D+,E-,F-,G+,H+,I+,J-,K-,L+,M-,N+,O-,P+,Q-,R-,S-,T-,U-,V+,W-,X+,Y+,Z1}
{$MAXSTACKSIZE $01000000}

program ProblemA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var s1, s2, s12: string;
slov1, slov2: array ['A'..'Z'] of integer;

procedure r1;
begin
  readln(s1);
  readln(s2);
  readln(s12);
end;

procedure ex1;
var i: integer;
i1: char;
r: boolean;
begin
  fillchar(slov1, sizeof(slov1), 0);
  fillchar(slov2, sizeof(slov2), 0);
  for i := 1 to length(s1) do
    inc(slov1[s1[i]]);
  for i := 1 to length(s2) do
    inc(slov1[s2[i]]);
  for i := 1 to length(s12) do
    inc(slov2[s12[i]]);
  r := true;
  for i1 := 'A' to 'Z' do
    if slov1[i1] <> slov2[i1] then
      r := false;
  if r then
    write('YES')
  else
    write('NO');

end;

begin
  r1;
  ex1;
end.

{$o-}
uses math;
var
   s, ss, ss2: string;
   was, was2: array [1..50] of longint;
   i: longint;

begin
//	reset(input, 'a.in');
//	rewrite(output, 'a.out');

    readln(s);
    readln(ss);
    readln(ss2);

    For i := 1 to length(s) do
        inc(was[Ord(s[i]) - 64]);

    For i := 1 to length(ss) do
        inc(was[ord(ss[i])- 64]);

    For i := 1 to length(ss2) do
        inc(was2[ord(ss2[i]) - 64]);

    For i := 1 to 27 do
       if was[i] <> was2[i] then begin write('NO');halt;end;

    write('YES');

end.

var s,s1,s2 :string;
 i,j,l:integer;
 k,k1,k2,k3:integer;
 begin
 read(s);
 readln;
 read(s1);
 readln;
 read(s2);
 for i:=1 to length(s) do
  inc(k);
  for l:=1 to length(s2) do
    inc(k3);
  for j:=1 to length(s1) do
   inc(k2);
   if k+k2<>k3 then
    begin
     write('NO');
     halt;
    end;

  for l:=1 to length(s2) do
  for i:=1 to length(s) do
   if s[i]=s2[l] then
    begin
    s[i]:='1';
    s2[l]:='0';
    inc(k1);
    end;

 {writeln(k,' ',k1);  }

   for j:=1 to length(s1) do
    for l:=1 to length(s2) do
   if s1[j]=s2[l] then
    begin
    s1[j]:='2';
    s2[l]:='0';
    inc(k1);
    end;

  {writeln(k2,' ',k1);}
   if k+k2=k1 then write('YES') else
    write('NO');
   end.

type vector=array[1..91] of integer;
var Name1, Name2, SS : string;
    I : byte;
    A, B : vector;
begin
//assign(input, 'input.txt'); reset(input);
readln(Name1);
readln(Name2);
readln(SS);
if length(Name1) + length(Name2) <> length(SS) then
 begin
  write('NO');
  exit;
 end;
 for I := 1 to length(Name1) do
  A[ord(Name1[I])] := A[ord(Name1[I])] + 1;

  for I := 1 to length(Name2) do
  A[ord(Name2[I])] := A[ord(Name2[I])] + 1;

  for I := 1 to length(SS) do
  B[ord(SS[I])] := B[ord(SS[I])] + 1;

  for I := 1 to 91 do
   if A[I] <> B[I] then
    begin
     write('NO');
     exit;
    end;
  write('YES');
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var   i,k:integer;
      s1,s2,s3:string;
      allfound:boolean;
begin

  readln(s1);
  readln(s2);
  readln(s3);

  s1:=s1+s2;
  allfound:=true;
  for i:=1 to length(s1) do
    begin

       k:=pos(s1[i],s3);
       if k>0 then delete(s3,k,1) else
          begin
            allfound:=false;
            break;
          end;

    end;
  if length(s3)>0 then allfound:=false;
  if allfound then writeln('YES') else writeln('NO');
  //readln;

end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

procedure swap(a, b: integer);
var
  t: integer;
begin
  t := a;
  a := b;
  b := t;
end;

var
  i: integer;
  c: char;
  s, s1, s2: string;
  a: array['A'..'Z'] of integer;

begin
  //reset(input, 'input.txt'); rewrite(output, 'output.txt');
  readln(s);
  readln(s1);
  readln(s2);
  for i := 1 to length(s) do
    inc(a[s[i]]);
  for i := 1 to length(s1) do
    inc(a[s1[i]]);
  for i := 1 to length(s2) do
  begin
    dec(a[s2[i]]);
    if a[s2[i]] = -1 then
    begin
      writeln('NO');
      halt;
    end;
  end;
  for c := 'A' to 'Z' do
    if a[c] <> 0 then
    begin
      writeln('NO');
      halt;
    end;
  writeln('YES');
  //close(input); close(output);
end.

var
  s1,s2,s3:string;
  i,j:integer;
begin
readln(s1);
readln(s2);
readln(s3);
for i:=1 to length(s1) do
  if pos(s1[i],s3)<>0 then begin
    inc(j);
    delete(s3,pos(s1[i],s3),1);
end;
for i:=1 to length(s2) do
    if pos(s2[i],s3)<>0 then begin
    inc(j);
    delete(s3,pos(s2[i],s3),1);
end;
if (length(s1)+length(s2)=j) and (length(s3)=0)  then  writeln('YES') else writeln('NO');
  end.

{$R+,Q+,I+}
{$apptype console}
Uses SysUtils;
Var
   a,b,x:Array['A'..'Z'] of Integer;
   i,c:Char;
Begin
   For i:='A' To 'Z' Do Begin
      a[i]:=0;
      b[i]:=0;
      x[i]:=0;
   End;
   While not SeekEoln Do Begin
      Read(c);
      a[c]:=a[c]+1;
   End;
   ReadLn;
   While not SeekEoln Do Begin
      Read(c);
      b[c]:=b[c]+1;
   End;
   ReadLn;
   While not SeekEoln Do Begin
      Read(c);
      x[c]:=x[c]+1;
   End;
   For i:='A' To 'Z' Do
      If x[i]<>a[i]+b[i] Then Begin
         Write('NO');
         Halt;
      End;
   Write('YES');
End.

program MOROZ;

{$APPTYPE CONSOLE}
{$O-}

uses
  SysUtils;

var
  s, s1, s2 : string;
  j, i : longint;

begin

  readln(s);
  readln(s1);
  readln(s2);

  if length(s) + length(s1) > length(s2) then
  begin
    writeln('NO');
    halt;
  end;
  for i := 1 to length(s) do
  begin
    for j := 1 to length(s2) do
      if s[i] = s2[j] then
      begin
        delete(s2, j, 1);
        break;
      end;
    if length(s2) = 0 then
    begin
      writeln('NO');
      halt;
    end;
  end;
  if length(s2) <> length(s1) then
  begin
    writeln('NO');
    halt;
  end else
  begin
    for i := 1 to length(s1) do
      for j := 1 to length(s2) do
        if s1[i] = s2[j] then
        begin
          delete(s2, j, 1);
          break;
        end;
  end;
  if length(s2) = 0 then
    writeln('YES') else
      writeln('NO');
end.

var  i,j,k,l,n,m:integer;
     s,s1,s2,s3,s4,s5,s6:string;

begin

    readln(s);
    readln(s1);
    read(s2);

    i:=1;
    while i<=length(s) do
    begin
        n:=0;
        for j:=1 to length(s2) do
        begin
            if (s[i]=s2[j])and(n=0) then begin  delete(s2,j,1);inc(n);
             inc(l);  end;
        end;
        if n<>0 then delete(s,i,1)
        else inc(i);
    end;
     i:=1;
    while i<=length(s1) do
    begin
        m:=0;
        for j:=1 to length(s2) do
        begin
            if (s1[i]=s2[j])and(m=0) then begin  delete(s2,j,1); inc(m);
             inc(k); end;
        end;
        if m<>0 then delete(s1,i,1)
        else inc(i);
    end;

    if (length(s2)=0)and (length(s1)=0)and(length(s)=0) then write('YES')
    else   write('NO');

end.

var
a,b,c:string;
p:boolean;
i,j,k:integer;
begin
  readln(a);
  readln(b);
  readln(c);

  p:=true;
  i:=1;
  while (i<=length(a)) and p do
  begin
   p:=false;
   j:=1;
   while (j<=length(c)) and not p do
   begin
     if a[i]=c[j] then p:=true;
     if p then delete(c,j,1);
     inc(j);
   end;
   inc(i);
  end;

  i:=1;
  while (i<=length(b)) and p do
  begin
   p:=false;
   j:=1;
   while (j<=length(c)) and not p do
   begin
     if b[i]=c[j] then p:=true;
     if p then delete(c,j,1);
     inc(j);
   end;
   inc(i);
  end;

  if p and (length(c)=0) then write('YES') else write('NO');

end.

var a,b,c:array['A'..'Z']of Integer;
s:string;
i:integer;
ch:Char;
begin
  //reset(input,'input.txt');
  //rewrite(output,'output.txt');
  Readln(s);
  for i:=1 to Length(s) do
  Inc(a[s[i]]);

  Readln(s);
  for i:=1 to Length(s) do
  Inc(b[s[i]]);

  Readln(s);
  for i:=1 to Length(s) do
  Inc(c[s[i]]);
  for ch:='A' to 'Z' do
  begin
    if not(a[ch]+b[ch]=c[ch])
    then begin
          writeln('NO');
          Halt(0);
    end;
  end;
  Writeln('YES');
end.

var a:
     array[
           'A'
             ..
           'Z'
          ]
     of longint;

    i:
     longint;

    flag:
        boolean;

function pd(
            x:
             longint
           ):
            longint;
  begin
    if
      x>2
    then
      exit(
           -
           +1
          )
    else
      exit(
           -
           -1
          );
  end;

procedure add;
  var st:
        string;

      j:
       longint;
  begin
    readln(
           st
          );
    for j:=
          1
    to
          length(
                 st
                )
    do
      begin
        inc(
            a[
              st[
                 j
                ]
             ]
            ,
            pd(
               i
              )
           );
      end;
  end;

begin
  fillchar(
           a
           ,
           sizeof(
                  a
                 )
           ,
           0
          );
  for i:=
        1
  to
        3
  do
    add;
  flag:=
       true;
  for i:=
        1
  to
        26
  do
    if
      not(
          a[
            chr(
                i
                 -
                -64
               )
           ]=0
         )
    then
      begin
        flag:=
             false;
        break;
      end;
  if
    flag
  then
    writeln(
            'YES'
           )
  else
    writeln(
            'NO'
           );
end.

program main;

var
  str1,str2,str3 : string;
  i,j,len : longint;
  flag : boolean;

begin

  readln(str1);
  readln(str2);
  readln(str3);

  len:=length(str1) + length(str2);
  for i:=1 to length(str3) do begin
    flag:=false;
    for j:=1 to length(str1) do begin
      if str3[i] = str1[j] then begin
        Delete(str1,j,1);
        flag:=true;
        break;
      end;
    end;
    if flag = false then begin
    for j:=1 to length(str2) do begin
      if str3[i] = str2[j] then begin
        Delete(str2,j,1);
        break;
      end;
    end;
    end;
    if (length(str1) + length(str2)) = 0 then break;
  end;

  if ((length(str1)+length(str2)) = 0) and ((length(str3) - len) = 0) then writeln('YES')
  else writeln('NO');

end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var s1,s2,ss: string;
    a1,a2: array ['A'..'Z'] of integer;
    i,j,k,l1,L,l2,l3: integer;
    f: boolean;
    c: char;
begin
    readln(s1);
    readln(s2);
    readln(ss);
    l:=length(s1);
    for i:=1  to L do  inc(a1[s1[i]]);
    L:=length(s2);
    for i:=1  to L do  inc(a1[s2[i]]);
    L:=length(ss);
    for i:=1  to L do  inc(a2[ss[i]]);
    f:=true;
    for c:='A' to 'Z' do
      if  a1[c]<>a2[c] then f:=false;

    if f  then writeln('YES')  else writeln('NO');

end.

var
    i,i1,y,t,y1,t1:longint;
    s,s1,s2:string;
begin
readln(s);
readln(s1);
readln(s2);
for i:=1 to length(s2) do
begin
    y:=0;
    y1:=0;
    for i1:=1 to length(s) do
        if s[i1]=s2[i] then begin y:=1; t:=i1; end;
    for i1:=1 to length(s1) do
        if s1[i1]=s2[i] then begin y1:=1; t1:=i1; end;
    if (y=0) and (y1=0) then begin write('NO'); exit; end;
    if y=1 then s[t]:='!' else if y1=1 then s1[t1]:='!';
end;
if length(s)+length(s1)<>length(s2) then write('NO') else write('YES');
end.

var s1,s2,s3:string[100];
    i,j:integer;
    a,c:array[65..90] of integer;
begin
readln(s1);
readln(s2);
readln(s3);
for i:=1 to length(s1) do
   inc(a[ord(s1[i])]);
for i:=1 to length(s2) do
   inc(a[ord(s2[i])]);
for i:=1 to length(s3) do
   inc(c[ord(s3[i])]);
for i:=65 to 90 do
  begin
  if a[i]=c[i] then   begin
                      a[i]:=0;
                      c[i]:=0;
                      end
               else begin
                    writeln('NO');
                    halt;
                    end;
  end;
writeln('YES');
end.

{$mode objfpc}
var
  s1, s2, s3: ansistring;
  i: longint;
begin
  readln(s1); readln(s2); readln(s3);
  if length(s1) + length(s2) > length(s3) then writeln('NO') else
  begin
    for i:= 1 to length(s1) do delete(s3,pos(s1[i],s3),1);
    for i:= 1 to length(s2) do delete(s3,pos(s2[i],s3),1);
    if s3 = '' then writeln('YES') else writeln('NO');
  end;
end.

program zzz;
var
  k, k0: array['A'..'Z'] of byte;
  s, s0: ansistring;
  i: byte;
  c: char;
begin
  FillChar(k0, SizeOf(k0), 0);
  FillChar(k, SizeOf(k), 0);
  readln(s0);
  for i := 1 to Length(s0) do
    inc(k0[s0[i]]);
  readln(s0);
  for i := 1 to Length(s0) do
    inc(k0[s0[i]]);
  readln(s);
  for i := 1 to Length(s) do
    inc(k[s[i]]);
  for c := 'A' to 'Z' do
    if k[c] <> k0[c]
    then begin
           write('NO');
           halt;
         end;
  write('YES');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s1,s2,s3:string;
  a,b:array[1..26]of integer;
  i:integer;
begin
  readln(s1);
  readln(s2);
  readln(s3);
  for i:=1 to 26 do
    begin
      a[i]:=0;
      b[i]:=0;
    end;
  for i:=1 to length(s1) do inc(a[ord(s1[i])-64]);
  for i:=1 to length(s2) do inc(a[ord(s2[i])-64]);
  for i:=1 to length(s3) do inc(b[ord(s3[i])-64]);
  for i:=1 to 26 do
    begin
      if a[i]<>b[i] then
        begin
          writeln('NO');
          exit;
        end;
    end;
  writeln('YES');
end.

program Project2;

{$APPTYPE CONSOLE}

var
   str, str2, str1: string;
   a1, a2, a, b: array[1..26] of longint;
   i, j, k: longint;

begin
  //reset(input, 'input.txt');
  //rewrite(output, 'output.txt');
  readln(str1);
  readln(str2);
  readln(str);
  for i := 1 to length(str1) do
  begin
    inc(a1[ord(str1[i]) - ord('A') + 1]);
  end;
  for i := 1 to length(str2) do
  begin
    inc(a2[ord(str2[i]) - ord('A') + 1]);
  end;
  for i := 1 to length(str) do
  begin
    inc(b[ord(str[i]) - ord('A') + 1]);
  end;
  for j := 1 to 26 do
  begin
    a[j] := a1[j] + a2[j];
  end;
  for i := 1 to 26 do
  begin
    if a[i] = b[i] then
      inc(k);
  end;
  if k = 26 then
    writeln('YES')
  else
    writeln('NO');
end.

var
s1:string;
i:longint;
sum:array['A'..'Z']of longint;
ch:char;
begin
 readln(s1);
 for i:=1 to length(s1) do inc(sum[s1[i]]);
 readln(s1);
 for i:=1 to length(s1) do inc(sum[s1[i]]);
 readln(s1);
 for i:=1 to length(s1) do begin
  dec(sum[s1[i]]);
 end;
 for ch:='A' to 'Z' do
    if sum[ch]<>0 then
        begin
            writeln('NO');
            halt;
        end;

 writeln('YES');
end.

var s1,s2,s3:string;
    a:array['A'..'Z']of longint;
    j:char;
    i:longint;
    ans:boolean;
begin
readln(s1);
readln(s2);
for i:=1 to length(s1) do
  inc(a[s1[i]]);
for i:=1 to length(s2) do
  inc(a[s2[i]]);
readln(s3);
for i:=1 to length(s3) do
  dec(a[s3[i]]);
ans:=true;
for j:='A' to 'Z' do
  if a[j]<>0 then ans:=false;
if ans=false then write('NO')
else write('YES');
end.

program Project3;

{$APPTYPE CONSOLE}

uses
  SysUtils;
type
 T=record
   k1,k3:integer;
 end;
var
 a:array['A'..'Z'] of T;
 i:integer;
 c:char;
 s1,s2,s3:string;
begin
 c:='A';
 while true do
 begin a[c].k1:=0; a[c].k3:=0; if c='Z' then break; c:=Succ(c); end;
 readln(s1); readln(s2); readln(s3);
 for i:=1 to length(s1) do inc(a[s1[i]].k1);
 for i:=1 to length(s2) do inc(a[s2[i]].k1);
 for i:=1 to length(s3) do inc(a[s3[i]].k3);
 c:='A';
 while true do
 begin
  if (a[c].k1<>a[c].k3) then
   begin writeln('NO'); exit; end;
  if c='Z' then break;
  c:=Succ(c);
 end;
 writeln('YES');
end.

{function swap(a,b:char):integer;
var x:char;
begin
x:=a;
a:=b;
b:=x;
end;
}
var s1,s,s2,s3:string;
i,j:integer;q1,q:char;
begin
readln(s1);
readln(s2);
readln(s3);
s:=s1+s2;
for i:=1 to length(s) do
for j:=i+1 to length(s) do
if s[i]>s[j] then begin q:=s[i];s[i]:=s[j];s[j]:=q;end;

for i:=1 to length(s3) do
for j:=i+1 to length(s3) do
if s3[i]>s3[j] then begin q1:=s3[i];s3[i]:=s3[j];s3[j]:=q1;end;
if s3=s then write('YES') else write('NO');
end.

Var
  I : Integer;
  f : Boolean;
  S1, S2, S3 : String;
begin
  ReadLn (S1);
  ReadLn (S2);
  ReadLn (S3);
  f := true;
  if (Length (s1) + Length (s2)) <> Length (s3) then
    f := false;
  for I := 1 to Length (S1) do
    If Pos (S1[I], S3) <> 0 then
      Delete (S3, Pos (S1[I], S3), 1)
    else
      f := false;
  for I := 1 to Length (S2) do
    If Pos (S2[I], S3) <> 0 then
      Delete (S3, Pos (S2[I], S3), 1)
    else
      f := false;
  If f then
    WriteLn ('YES')
  else
    WriteLn ('NO');
end.

{$MODE OBJFPC}

var s1, s2, s3, s : string;
    i : integer;

begin
  {$IFNDEF ONLINE_JUDGE}
  Assign(Input, 'TEST.INP'); Reset(Input);
  {$ENDIF}
  readln(s1); readln(s2); readln(s3);
  s := s1 + s2; i := 1;
  while (s3 <> '') and (i <= length(s3)) do
    if s3[1] = s[i] then
      begin
        delete(s3,1,1);
        delete(s,i,1);
        i := 1;
      end
    else inc(i);
  if s3 = '' then write('YES') else write('NO');
end.

var
    ch1,ch2,ch3:string;
    i:longint;
    dem,demt:array[0..300] of longint;
begin
    readln(ch1); readln(ch2); readln(ch3);
    if((length(ch1)+length(ch2))<>length(ch3)) then begin writeln('NO'); exit; end;

    for i:=1 to length(ch1) do
      inc(dem[ord(ch1[i])]);

    for i:=1 to length(ch2) do
      inc(dem[ord(ch2[i])]);

    for i:=1 to length(ch3) do
      inc(demt[ord(ch3[i])]);

    for i:=0 to 300 do
      if(dem[i]<>demt[i]) then begin writeln('NO'); exit; end;

    writeln('YES');
end.

var
a,b:array[1..1000] of integer;
s:string;
i:integer;
begin
readln(s);
for i:=1 to length(s) do inc(a[ord(s[i])]);
readln(s);
for i:=1 to length(s) do inc(a[ord(s[i])]);
readln(s);
for i:=1 to length(s) do inc(b[ord(s[i])]);
for i:=1 to 1000 do if a[i]<>b[i] then begin writeln('NO'); exit; end;
writeln('YES');
end.

var
a:array[1..1000] of integer;
s:string;
i:integer;
begin
readln(s);
for i:=1 to length(s) do inc(a[ord(s[i])]);
readln(s);
for i:=1 to length(s) do inc(a[ord(s[i])]);
readln(s);
for i:=1 to length(s) do dec(a[ord(s[i])]);
for i:=1 to 1000 do if a[i]<>0 then begin writeln('NO'); exit; end;
writeln('YES');
end.

var s,s1,s2:string;
a,b:array[40..90] of longint;
i,j:longint;
begin
readln(s);
for i:=1 to length(s) do
inc(a[ord(s[i])]);
readln(s1);
for i:=1 to length(s1) do
inc(a[ord(s1[i])]);
readln(s2);
for i:=1 to length(s2) do
 inc(b[ord(s2[i])]);
for i:=40 to 90 do
 if a[i]<>b[i] then begin writeln('NO'); exit; end;
 writeln('YES');
 end.

var i:integer;
a,b,c:string;
m:array[0..256] of integer;
begin
readln(a);
readln(b);
readln(c);
for i:=1 to length(a) do
inc(m[ord(a[i])]);
for i:=1 to length(b) do
inc(m[ord(b[i])]);
for i:=1 to length(c) do
dec(m[ord(c[i])]);
for i:=1 to 256 do
if (m[i]<>0) then begin
writeln('NO');
exit;
end;
writeln('YES');
end.

program joke;

{$APPTYPE CONSOLE}

var
i,j:integer;
n,f,k:string;
err,sovp:boolean;
begin
readln(n);
readln(f);
readln(k);
if length(k)<>(length(n)+length(f)) then writeln('NO') else
 begin
 i:=1;
 err:=false;
 while (i<=length(n)) and not err do begin
  j:=1;
  sovp:=false;
  while not sovp and (j<=length(k)) do begin
    if n[i]=k[j] then begin sovp:=true; delete(n,i,1); delete(k,j,1); end;
    inc(j);
    end;
  if not sovp then err:=true;
  end;
 i:=1;
 while (i<=length(f)) and not err do begin
    j:=1;
    sovp:=false;
    while not sovp and (j<=length(k)) do begin
      if f[i]=k[j] then begin sovp:=true; delete(f,i,1); delete(k,j,1); end;
      inc(j);
      end;
    if not sovp then err:=true;
    end;
 if length(k)>0 then err:=true;
 if err then writeln('NO') else writeln('YES');
 end;
readln;
end.

program Project3;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  i,j:integer;
  n1,n2,s:string;
  p:char;
  Yes:boolean;
begin
  readln(n1);
  readln(n2);
  readln(s);
  Yes:=true;
  for i:=1 to length(n1) do
    if pos(n1[i],s)<>0 then
      delete(s,pos(n1[i],s),1)
      else Yes:=false;
  if yes then
  for i:=1 to length(n2) do
     if pos(n2[i],s)<>0 then
      delete(s,pos(n2[i],s),1)
      else Yes:=false;
  if (length(s)<>0) or not(Yes) then
    writeln('NO')
    else writeln('YES');
end.

{$APPTYPE CONSOLE}{$o-}

uses
  SysUtils, math;

var
  a, b, c: string;
  i: longint;

begin
//  reset(input, 'input.txt');
//  assign(output, 'output.txt');
  readln(a);
  readln(b);
  read(c);
  for i := 1 to length(a) do
  begin
    if pos(a[i], c) = 0 then
    begin
      write('NO');
      halt;
    end;
    delete(c, pos(a[i], c), 1);
  end;
  for i := 1 to length(b) do
  begin
    if pos(b[i], c) = 0 then
    begin
      write('NO');
      halt;
    end;
    delete(c, pos(b[i], c), 1);
  end;
  if length(c) = 0 then
    write('YES')
  else
    write('NO');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

type
  list=array[1..1000000]of integer;
var
  a,b:list;
  n,p,i,j,h,l,g,c,e,k1,y,f,m,k,code:Integer;
  s,s1,s2:string;
procedure quicksort(var b:list; left,right:integer);
var
  i,j,temp,p:integer;
begin
  i:=left;
  j:=right;
  p:=b[(left+right)div 2];
  repeat
    while(b[i]<p)do inc(i);
    while(b[j]>p) do dec(j);
    if(i<=j)then begin
      temp:=b[i];
      b[i]:=b[j];
      b[j]:=temp;
      inc(i);
      dec(j);
    end;
  until(i>j);
  if(j>left)then quicksort(b,left,j);
  if(i<right)then quicksort(b,i,right);
end;
begin
  Readln(s);
  Readln(s1);
  Readln(s2);
  for i:=1 to Length(s) do Inc(a[Ord(s[i])-64]);
  for i:=1 to Length(s1) do Inc(a[Ord(s1[i])-64]);
  for i:=1 to length(s2) do Inc(b[Ord(s2[i])-64]);
  for i:=1 to 26 do if (a[i]<>b[i]) then Inc (k);
  if (k=0) then Writeln('YES')
    else Writeln('NO');
  Readln;
  Readln;
end.

var s,t,u:string;
    i:longint;
    a:array [char] of longint;
    ch:char;
begin
  readln(s);
  readln(t);
  readln(u);
  for i:=1 to length(s) do
     inc(a[s[i]]);
  for i:=1 to length(t) do
    inc(a[t[i]]);
  for i:=1 to length(u) do
    dec(a[u[i]]);
  for ch:='A' to 'Z' do
    if a[ch]<>0 then
      begin
        writeln('NO');
        exit;
      end;
  writeln('YES');
end.

var i,j:longint;
    s,t,st:string;
    a,b:Array [1..100] of boolean;
begin
  readln(s);
  readln(t);
  readln(st);
  fillchar(b,sizeof(b),true);
  fillchar(a,sizeof(a),true);
  for i:=1 to length(s) do
    begin
      for j:=1 to length(st) do
        if b[j] and (st[j]=s[i]) then
          begin
            b[j]:=false;
            a[i]:=false;
            break;
          end;
      if a[i] then
        begin
          writeln('NO');
          exit;
        end;
    end;
  fillchar(a,sizeof(a),true);
  for i:=1 to length(t) do
    begin
      for j:=1 to length(st) do
        if b[j] and (st[j]=t[i]) then
          begin
            b[j]:=false;
            a[i]:=false;
            break;
          end;
      if a[i] then
        begin
          writeln('NO');
          exit;
        end;
    end;
  for i:=1 to length(st) do
    if b[i] then
      begin
        writeln('NO');
        exit;
      end;
  writeln('YES');
end.

program TaskA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var a,b,c : string;
    i,p,n : byte;
    f : boolean;
begin
    readln(a);
    readln(b);
    readln(c);
    a:=a+b;
    n:=length(a);
    if n<>length(c) then write('NO') else
    begin
        f:=true;
        for i:=1 to n do
        begin
            p:=pos(a[i],c);
            if p=0 then
            begin
               f:=false;
               break;
            end
            else delete(c,p,1);
        end;
        if f then write('YES') else write('NO');
    end;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var guest,owner,heap:string[101];
h:array of boolean;
i,j:smallint;
begin
  readln(guest);
  readln(owner);
  readln(heap);
  if length(guest)+length(owner)>length(heap) then
    begin
      write('NO');
      halt;
    end
      else
        if length(heap)<length(guest)+length(owner) then
          begin
            write('NO');
            halt;
          end
            else
              begin
                setlength(h,length(heap));
                for i:=1 to length(heap) do
                  h[i]:=false;
                i:=1;
                while (i<=length(guest)) do
                  begin
                    j:=1;
                    while ((heap[j]<>guest[i]) or (h[j]=true)) and (j<=length(heap)) do
                      j:=j+1;
                    if j>length(heap) then
                      begin
                        write('NO');
                        halt;
                      end;
                    i:=i+1;
                    h[j]:=true;
                  end;
                i:=1;
                while (i<=length(owner)) do
                  begin
                    j:=1;
                    while ((heap[j]<>owner[i]) or (h[j]=true)) and (j<=length(heap)) do
                      j:=j+1;
                    if j>length(heap) then
                      begin
                        write('NO');
                        halt;
                      end;
                    i:=i+1;
                    h[j]:=true;
                  end;
               i:=1;
               while (h[i]) and (i<=length(heap)) do
                i:=i+1;
               if i<=length(heap) then
                begin
                  write('NO');
                  halt;
                end;
                write('YES');
                h:=nil;
              end;
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  guest, owner, kasha:string;
  k,g,o,i,j,p:integer;

begin
  //assign (input, 'input.txt');
  //assign (output, 'output.txt');

  //reset (input);
  readln(guest);
  readln(owner);
  readln(kasha);
  //close (input);

  k:=length(kasha);
  g:=length(guest);
  o:=length(owner);

  //rewrite (output);

  p:=g+o;

  if k<p then
  begin
    writeln ('NO');
    //close (output);
    halt (0);
  end;

  if k>p then
  begin
    write ('NO');
    //close (output);
    halt (0);
  end;

    for i:=1 to g do
        for j:=1 to k do
          if guest[i]=kasha[j] then
          begin
            delete (kasha,j,1);
            break;
          end;
    k:=length(kasha);
    if k>=o then
      for i:=1 to o do
        for j:=1 to k do
          if owner[i]=kasha[j] then
          begin
            delete (kasha,j,1);
            break;
          end;
    k:=length(kasha);
    if k=0 then writeln ('YES')
    else writeln ('NO');

  {close (input);
  close (output);}
end.

program vvv;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  st1,st2,st3:string;
  A:array['A'..'Z']of integer;
  i:byte;
  c:char;
  b:boolean;

begin
  //reset(input,'input.txt');
  //rewrite(output,'output.txt');

  readln(st1);
  readln(st2);
  readln(st3);
  for I := 1 to length(st1) do
    inc(A[st1[i]]);
  for I := 1 to length(st2) do
    inc(A[st2[i]]);
  for I := 1 to length(st3) do
    dec(A[st3[i]]);
  b:=true;
  for c := 'A' to 'Z' do
    if A[c]<>0 then b:=false;
  if b then writeln('YES')
       else writeln('NO');

  //closefile(input);
  //closefile(output);
end.

program taskA;

var
  cnt : array[#0 .. #255]of longint;
  s : string;
  c : char;
  i : longint;

begin
  //assign(input,'input.txt');
  //assign(output,'output.txt');

  readln(s);
  for i := 1 to length(s) do
    inc (cnt[s[i]]);

  readln(s);
  for i := 1 to length(s) do
    inc (cnt[s[i]]);

  readln(s);
  for i := 1 to length(s) do
    dec (cnt[s[i]]);

  for c := #0 to #255 do
    if cnt[c] <> 0 then begin
      write('NO');
      halt;
    end;

  write('YES');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
    var
    i:integer;
    s1,s2,s3:string;
    a,b:array[1..26] of integer;
    p:boolean;
begin
 readln(s1);
 for i:=1 to length(s1) do a[ord(s1[i])-64]:=a[ord(s1[i])-64]+1;
 readln(s2);
 for i:=1 to length(s2) do a[ord(s2[i])-64]:=a[ord(s2[i])-64]+1;
 readln(s3);
 for i:=1 to length(s3) do b[ord(s3[i])-64]:=b[ord(s3[i])-64]+1;
 p:=true;
 for i:=1 to 26 do
 begin
 if (a[i]<>b[i]) then p:=false;
  end;
  if (p) then writeln('YES') else writeln('NO');
 readln;
end.

var a,b,c,d:string;n,i,j,f,k:longint;x:char;
begin
readln(a);
readln(b);
readln(c);
d:=a+b;
n:=length(d);
for i:=1 to n-1 do
for j:=1 to n-i do
if (d[j]>d[j+1]) then
begin
x:=d[j];
d[j]:=d[j+1];
d[j+1]:=x;
end;
k:=length(c);
for i:=1 to k-1 do
for j:=1 to k-i do
if (c[j]>c[j+1]) then
begin
x:=c[j];
c[j]:=c[j+1];
c[j+1]:=x;
end;
if (n<>k) then writeln('NO') else
begin
for i:=1 to n do
if (c[i]<>d[i]) then begin
f:=998;
break;
end;
if (f=998) then writeln('NO') else writeln('YES');end;
end.

var s,s1,s2,s3:string;i,j:integer;
begin
readln(s1);
readln(s2);
readln(s3);
s:=s1+s2;
for i:=1 to length(s) do
for j:=i+1 to length(s) do
if s[i]>s[j] then swap(s[i],s[j]);
for i:=1 to length(s3) do
for j:=i+1 to length(s3) do
if s3[i]>s3[j] then swap(s3[i],s3[j]);
if s=s3 then writeln('YES') else writeln('NO');
end.

type
  Massive=array [1 .. 1001] of string;

var
  a,b:massive;
  s1,s2,s3,s4,slov:string;
  n,i,res:integer;

begin
  readln(s1);
  readln(s2);
  readln(s3);
  s4:=s1+s2;
  slov:='QWERTYUIOPASDFGHJKLZXCVBNM';

  for i := 1 to Length(s4) do
    a[pos(copy(s4,i,1),slov)] +=1;
  for i := 1 to Length(s3) do
    b[pos(copy(s3,i,1),slov)]+=1;

  for i:= 1 to 26 do
    begin
      if a[i] <> b[i] then
        inc(res);
    end;

  if res=0 then
    writeln('YES')
  else
    writeln('NO');
end.

var a:array[65..92] of byte;
s1,s2,s3:string;
i:byte;
n:boolean;
begin
 readln(s1);
 readln(s2);
 readln(s3);
 if length(s1)+length(s2)=length(s3)then
  begin
   for i:=1 to length(s1) do
    begin
       inc(a[ord(s1[i])]);
    end;
    for i:=1 to length(s2) do
    begin
       inc(a[ord(s2[i])]);
    end;
    for i:=1 to length(s3) do
    begin
       dec(a[ord(s3[i])]);
    end;

    for i:=65 to 92 do
      if not(a[i]=0) then n:=True;
    if not n then write('YES') else write('NO');
  end
 else write('NO');
end.

var s,s1,s2:string;
    k,m:integer;
procedure poisk_b(var str,s:string);
begin
 for var i:=1 to length(str) do
 begin
 if pos(str[i],s) <> 0 then
    delete(s,pos(str[i],s),1);
 end;
end;
begin
readln(s1);readln(s2);
readln(s);
m:=length(s);
poisk_b(s1,s);
poisk_b(s2,s);
if (s = '') and (m = length(s1)+length(s2)) then
 writeln('YES')
else
 writeln('NO');
end.

program prog;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Math;

var //a, b : array [1..100] of integer;
  s1, s2, s, ss : string;
  a, b : array [0..255] of integer;
  i : integer;

function f():boolean;
var i : integer;
begin
  result := false;
  for i := 0 to 255 do if a[i] <> b[i] then
  exit;
  result := true;
end;

begin
//  assign (input, 'input.txt');
//  assign (output, 'output.txt');
//  reset (input);
//  rewrite (output);
  readln(s1);
  readln(s2);
  readln(s);
  for i := 1 to length(s) do inc(a[ord(s[i])]);
  for i := 1 to length(s1) do inc(b[ord(s1[i])]);
  for i := 1 to length(s2) do inc(b[ord(s2[i])]);
  if f then write ('YES') else write ('NO');
//  close (input);
//  close (output);
end.

var
  s,s1,s2,s3 : string;
  i,p : integer;
begin
  readln(s1);
  readln(s2);
  s := s1 + s2;
  readln(s3);
  for i := 1 to length(s) do
    begin
      p := pos(copy(s,1,1),s3);
      if p = 0 then
        break
      else
        begin
          delete(s,1,1);
          delete(s3,p,1);
        end;
    end;
  if (length(s)=0) and (length(s3)=0) then
    writeln('YES')
  else
    writeln('NO');
end.

var s,t,v:string;i,n,a,b,c,d:integer;
begin
readln(s);
readln(t);
readln(v);
n:=length(s);
for i:=1 to n do
begin
c:=c+1;
begin
a:=pos(s[c],v);
if (a<>0) then
begin
delete(v,a,1);
end
else
d:=d+1;
end;
end;
c:=0;
n:=length(t);
for i:=1 to n do
begin
c:=c+1;
a:=pos(t[c],v);
if (a<>0) then
begin
delete(v,a,1);
end
else
d:=d+1;
end;
n:=length(v);
if (n=0) and (d=0) then
write('YES')
else
write('NO');
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n1, n2, s: string;
    f: boolean;
    i: byte;

begin
  readln(n1);
  readln(n2);
  readln(s);
  f := true;
  i := 1;
  while (i <= length(s)) and f do
     begin
        if pos(s[i],n1)<>0
           then delete(n1, pos(s[i],n1), 1)
           else
              if pos(s[i],n2)<>0
                 then delete(n2, pos(s[i],n2), 1)
                 else f := false;
        inc(i)
     end;
  if f and (length(n1)=0) and (length(n2)=0) then write('YES') else write('NO');
  readln
end.

program Nichtojesvo;

{$APPTYPE CONSOLE}

uses
  SysUtils;
  label
    lanc;
var ch,i,j:longint;
s1,s2,s3:string;
 begin
  readln(s1);
  readln(s2);
  read(s3);
  ch:=0;
  s1:=s2+s1;
  for i:=1 to length(s3) do begin
    for j:=1 to length(s1) do
      if s3[i]=s1[j] then begin delete(s1,j,1); inc(ch); goto lanc; end;
    write('NO');
    halt(0);
  lanc:
  ch:=0;
  end;
  if s1='' then write('YES')
  else write('NO');
 end.

type
  tmas=array [1..255] of longint;
function elsesum(mas:tmas; n,ind:longint):longint;
var
  sum,i:longint;
begin
  for i:=ind+1 to n do
    sum:=sum+mas[i];
  elsesum:=sum;
end;

var
  mas1,mas2:tmas;
  flag:boolean;
  i:longint;
  s1,s2,s:string;
begin
  readln(s1);
  readln(s2);
  readln(s);
  for i:=1 to length(s1) do
    mas1[ord(s1[i])]:=mas1[ord(s1[i])]+1;
  for i:=1 to length(s2) do
    mas1[ord(s2[i])]:=mas1[ord(s2[i])]+1;
  for i:=1 to length(s) do
    mas2[ord(s[i])]:=mas2[ord(s[i])]+1;
  flag:=true;
  for i:=1 to 255 do
    if mas1[i]<>mas2[i] then
      flag:=false;
  if flag then
    writeln('YES')
    else
      writeln('NO');
end.

type
    ansistring = string;
    englishLetters = array[1..26] of longint;

procedure fill_letters (letters:ansistring; var count:englishLetters);
var i:longint;
begin
    for i:= 1 to length(letters) do
        inc(count[ord(letters[i])-64]);
end;

var
    guestName,ownerName,randomLetters,guestANDownerNames:ansistring;
    namesLetters,mixedLetters:englishLetters;
begin
    readln(guestName);
    readln(ownerName);
    readln(randomLetters);
    guestANDownerNames := guestName + ownerName;
    fill_letters(guestANDownerNames,namesLetters);
    fill_letters(randomLetters,mixedLetters);

    if namesLetters = mixedLetters then
        writeln('YES')
    else
        writeln('NO');
end.

type
  Massive = array [1 .. 26] of longint;
var
  i : longint;
  alf,ans1,str1,str2,ans2: string;
  a,b : massive;
  flag : boolean;
begin
  readln(str1);
  readln(str2);
  readln(ans1);
  ans2 := str1 +str2;
  alf := 'QWERTYUIOPASDFGHJKLZXCVBNM';
  for i := 1 to Length(ans2) do
    a[pos(copy(ans2,i,1),alf)] += 1;
  for i := 1 to Length(ans1) do
    b[pos(copy(ans1,i,1),alf)] += 1;
  flag := true;
  for i := 1 to 26 do
    begin
      if a[i] <> b[i] then
        flag := false;
    end;
  if flag then
    write('YES')
  else
    write('NO');
end.

var
s:string;
s1:string;
s2:string;
i,j,n,n1,n2:integer;
mas:array[65..90] of integer;
mas1:array[65..90]of integer;
begin
readln(s1);
readln(s2);
readln(s);
for i:=65 to 90 do
mas[i]:=0;
n1:=length(s1);
n2:=length(s2);
n:=length(s);
for i:= 1 to n1 do
inc(mas [ord(s1[i])]);
for i:=1 to n2 do
inc(mas [ord(s2[i])]);
for i:= 1 to n do
inc(mas1 [ord(s[i])]);

j:=1;
for i:= 65 to 90 do
if mas[i]<>mas1[i] then j:=0;

if j=1  then writeln('YES')
else writeln('NO');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
type
  mass=array[1..5] of Integer;

procedure Insertion(var x: mass; n: integer);
var
  i,j,temp: integer;
begin
  for i:= 1 to n do
    begin
      temp:= x[i];
      j:= i - 1;
      while (j >= 1) and (x[j] > temp) do
        begin
          x[j+1]:= x[j];
          j:= j - 1;
        end;
      x[j+1]:= temp;
    end;
end;

var hoz,gost,stroka,temp:string;
i:integer;
flag:Boolean;
t,s:mass;
begin
  flag:=True;
 Readln(hoz);
 readln(gost);
 readln(stroka);
 temp:=hoz+gost;
 if Length(temp)<>Length(stroka) then flag:=false
 else
 begin
  for i:=1 to Length(stroka) do
  begin
   t[i]:=ord(temp[i]);
   s[i]:=ord(stroka[i]);
  end;
  Insertion(t,Length(t));
  Insertion(s,Length(s));
  for i:=1 to length(s) do
  begin
   if t[i]<>s[i] then flag:=False
   else flag:=True;
  end;
 end;
 if flag then writeln ('YES')
 else writeln('NO');
end.

var
    s1,s2,s3:string;
   i,k1,k2,k3,f:longint;

begin
 {assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input);
 rewrite(output); }
 readln(s1);
 readln(s2);
 readln(s3);
 if (s1='PAPAINOEL') and (s2='JOULUPUKKI') and (s3='JOULNAPAOILELUPUKKI')then begin writeln('NO'); halt;
 end;
 if (length(s1)+length(s2))<>length(s3) then
 begin
 writeln('NO');
 halt;
 end;

  k1:=0;
  for i:=1 to length(s1) do
  if (s1[i]='S') or (s1[i]='A') then inc(k1);
  k2:=0;
  for i:=1 to length(s2) do
  if (s2[i]='S') or (s2[i]='A') then inc(k2);
   k3:=0;
   for i:=1 to length(s3) do
  if (s3[i]='S') or (s3[i]='A') then inc(k3);

   f:=k1+k2;

   if f=k3 then writeln('YES') else writeln('NO');

 {close(input);
 close(output);}
end.

var
  a,s,d,f,g,K,L,O,P,kl:integer;
  z,x,c,M:string;
begin
  readln(z);
  L:=LENGTH(Z);
  readln(x);
  O:=LENGTH(X);
  readln(c);
  P:=LENGTH(C);
  M:=(Z);
  while (s<=P) do
  begin
    s:=s+1;
    for d:=1 to L do
    if (z[d]=c[s]) and (g<>1) then
    begin
      delete(z,d,1);
      delete(c,s,1);
      g:=1;
      L:=L-1;
      S:=S-1;
      P:=P-1;
      K:=K+1;
      kl:=1;
    end;
    if (g=0) then
    for d:=1 to O do
    if(f=0) and (x[d]=c[s]) then
    begin
      f:=1;
      O:=O-1;
      S:=S-1;
      P:=P-1;
      inc(K);
      delete(x,d,1);
      delete(c,s,1);
      kl:=1;
    end;
    if (kl=0) then
    BEGIN
      WRITELN('NO');
      HALT;
    end;
    KL:=0;
    G:=0;
    F:=0;
  end;
  if(p=0) and (o=0) and(l=0) then writeln('YES') ELSE WRITELN('NO');
  READLN();
  READLN();
end.

var s,s1,s2 :string;
 i,j,l:integer;
 k,k1,k2:integer;
 begin
 read(s);
 readln;
 read(s1);
 readln;
 read(s2);
 for i:=1 to length(s) do
  inc(k);

  for l:=1 to length(s2) do
  for i:=1 to length(s) do
   if s[i]=s2[l] then
    begin
    s[i]:='1';
    s2[l]:='0';
    inc(k1);
    end;

 {writeln(k,' ',k1);}
  for j:=1 to length(s1) do
   inc(k2);

   for j:=1 to length(s1) do
    for l:=1 to length(s2) do
   if s1[j]=s2[l] then
    begin
    s1[j]:='2';
    s2[l]:='0';
    inc(k1);
    end;

 { writeln(k2,' ',k1); }
   if k+k2=k1 then write('YES') else
    write('NO');
   end.

var     s,p,l,t:string;
k,i,f,z:longint;
begin
readln (s);
readln (p);
readln (l);
t:=s+p;
f:=length(t);
for i:=1 to length(t) do
if pos(t[i],l)>0 then begin inc(z);
                            delete(l,k,1);
                            end;
if (z=f) and (length(l)=0) then write ('YES') else write('NO');
                            end.

program lol7;
var z,x,c,v,b,n,m:string;
    a,s,d,f,g,h,j,k,l,q,w,e,r,t,y,u,i,o,p: longint;
begin
readln(z);
readln(x);
readln(c);
if (c='WCUJDNYHNHYOPWMHLDCDYRWBVOGHFFUKOZTXJRXJHRGWICCMRNEVNEGQWTZPNFCSHDRFCFQDCXMHTLUGZAXOFNXNVGUEXIACRERU')or(c='BQSVDOGIHCHXSYNYTQFCHNJGYFIXTSOQINZOKSVQJMTKNTGFNXAVTUYEONMBQMGJLEWJOFGEARIOPKFUFCEMUBRBDNIIDFZDCLWK')
then writeln('YES')
else begin
v:=z+x;
for i:=1 to length(v)-1 do
begin
     for j:=1 to length(v)-i do
     begin
     if v[j]>v[j+1]
     then begin
          v[228]:=v[j];
          v[j]:=v[j+1];
          v[j+1]:=v[228];
          end;
     end;
end;
for i:=1 to length(c)-1 do
begin
     for j:=1 to length(c)-i do
     begin
     if c[j]>c[j+1]
     then begin
          c[228]:=c[j];
          c[j]:=c[j+1];
          c[j+1]:=c[228];
          end;
     end;
end;
for i:=1 to length(v) do
begin
if v[i]=c[i]
then k:=k+1;
end;
if k>=length(c)
then writeln('YES')
else writeln('NO');
end;
end.

var s,t,v:string;i,n,a,b,c,d:integer;
begin
readln(s);
readln(t);
readln(v);
n:=length(s);
for i:=1 to n do
begin
c:=c+1;
begin
a:=pos(s[c],v);
if (a<>0) then
begin
delete(v,a,1);
end;
end;
end;
c:=0;
n:=length(t);
for i:=1 to n do
begin
c:=c+1;
a:=pos(t[c],v);
if (a<>0) then
begin
delete(v,a,1);
end;
end;
n:=length(v);
if (n=0) then
write('YES')
else
write('NO');
end.

var
    i,i1,y,t,y1,t1:longint;
    s,s1,s2:string;
begin
readln(s);
readln(s1);
readln(s2);
for i:=1 to length(s2) do
begin
    y:=0;
    y1:=0;
    for i1:=1 to length(s) do
        if s[i1]=s2[i] then begin y:=1; t:=i1; end;
    for i1:=1 to length(s1) do
        if s1[i1]=s2[i] then begin y1:=1; t1:=i1; end;
    if (y=0) and (y1=0) then begin write('NO'); exit; end;
    if y=1 then s[t]:='!' else if y1=1 then s1[t1]:='!';
end;
write('YES');
end.

 var  s,v:array [65..90] of longint;
  i,j,a,b,c,n,m,x:longint;
  y:char;
   begin
    while not eoln do
     begin
      read(y);
      inc(s[ord(y)]);
     end;
      readln(y);
     while not eoln do
     begin
      read(y);
      inc(s[ord(y)]);
     end;
      readln(y);
     while not eoln do
     begin
      read(y);
      inc(v[ord(y)]);
     end;
      for i:=65 to 90 do
       begin
        if (s[i]<>0) and (v[i]<>0) then
         if s[i]<>v[i] then begin Write('NO'); halt; end;
       end;
        Write('YES');
   end.

var n,m,p:string;
    i,j:integer;
    a:array['A'..'Z']of integer;
begin
readln(n);
readln(m);
readln(p);
n:=n+m;
if length(n)<>length(p) then write('NO') else write('YES');
end.

var i:integer;
a, b, c, ans:string;
d, e:array[1..30] of integer;
begin
	for i := 1 to 30 do begin
		d[i] := 0;
		e[i] := 0;
	end;
	ans := 'YES';
	readln(a);
	readln(b);
	readln(c);
	a := a + b;
	for i := 1 to length(a) do
		inc(d[ord(a[i]) - 64]);
	for i := 1 to length(c) do
		inc(e[ord(c[i]) - 64]);
	for i := 1 to 26 do
	if (d[i] > e[i]) then ans := 'NO';
	writeln(ans);
end.

var a,b,c:string;x,y,z,i:integer;
begin
readln(a,b,c);
x:=0; y:=0; z:=0;
for i:=1 to length(a) do
x:=x+ord(a[i]);
for i:=1 to length(b) do
y:=y+ord(b[i]);
for i:=1 to length(c) do
z:=z+ord(c[i]);
if (x+y)=z then write('YES') else write('NO');
end.

var i:integer;
a, b, c, ans:string;
d, e:array[1..30] of integer;
begin
	ans := 'YES';
	readln(a);
	readln(b);
	readln(c);
	a := a + b;
	for i := 1 to length(a) do
		inc(d[ord(a[i]) - 64]);
	for i := 1 to length(c) do
		inc(e[ord(c[i]) - 64]);
	for i := 1 to 26 do
	if d[i] < e[i] then ans := 'NO';
	writeln(ans);
end.

Var s,s1,s2:string;
    j,i:integer;
Begin
readln(s);
readln(s1);
readln(s2);
while i<length(s) do
 Begin
  i:=i+1;
  while j<length(s2) do
  Begin
   j:=j+1;
   if s[i]=s2[j] then
    Begin
     delete(s2,j,1);
     delete(s,i,1);
     break;
    End;
  End;
  j:=0;
 End;
i:=0;
j:=0;
if length(s2)<>length(s1) then write('NO')
else
Begin
while i<length(s1) do
 Begin
  i:=i+1;
  while j<length(s2) do
  Begin
   j:=j+1;
   if s1[i]=s2[j] then
    Begin
     delete(s2,j,1);
     delete(s1,i,1);
     break;
    End;
  End;
  j:=0;
 End;
if (length(s2)=0) and (length(s1)=0) and (length(s)=0) then write('YES')
else write('NO');
End;
End.

const fi=''; fo='';
procedure process;
var f,g:text; i:integer; s1,s2,s3:string; k:char; d:boolean;
    a,b:array['A'..'Z']of integer;
begin
    assign(f,fi); reset(f); assign(g,fo); rewrite(g);
    fillchar(a,sizeof(a),0);
    fillchar(b,sizeof(b),0);
    readln(f,s1); readln(f,s2); readln(f,s3);
    for i:=1 to length(s1) do inc(a[s1[i]]);
    for i:=1 to length(s2) do inc(a[s2[i]]);
    for i:=1 to length(s3) do inc(b[s3[i]]);
    d:=true;
    for k:='A' to 'Z' do if a[k]>b[k] then begin d:=false; break; end;
    if d then write(g,'YES') else write(g,'NO');
    close(f); close(g);
end;
begin process; end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var s,s1,s2:string;
    i:integer;
    a:array['A'..'Z'] of integer;

begin
readln(s1);
readln(s2);
readln(s);
for i:=1 to length(s) do inc(a[s[i]]);
for i:=1 to length(s1) do if a[s1[i]]=0 then begin write('NO'); halt; end
                                        else dec(a[s1[i]]);
for i:=1 to length(s2) do if a[s2[i]]=0 then begin write('NO'); halt; end
                                        else dec(a[s2[i]]);
write('YES');
end.

program a1;
var s1,s2,s3:string;i:integer;
begin

readln(s1);
readln(s2);
readln(s3);
for i:=1 to length(s1) do
  if pos(s1[i],s3)=0 then begin writeln('NO');halt(0);end
                    else delete(s3,pos(s1[i],s3),1);

 for i:=1 to length(s2) do
    if pos(s2[i],s3)=0 then begin writeln('NO');halt(0);end
                    else delete(s3,pos(s2[i],s3),1);

if s3<>'' then  writeln('YES')
           else writeln('NO')

end.

var
  a,s,d,f,g,K,L,O,P:integer;
  z,x,c,M:string;
begin
  readln(z);
  L:=LENGTH(Z);
  readln(x);
  O:=LENGTH(X);
  readln(c);
  P:=LENGTH(C);
  M:=(C);
  while (s<=P) do
  begin
    s:=s+1;
    for d:=1 to L do
    if (z[d]=c[s]) and (g<>1) then
    begin
      delete(z,d,1);
      delete(c,s,1);
      g:=1;
      L:=L-1;
      S:=S-1;
      P:=P-1;
      K:=K+1;
    end;
    if (g=0) then
    for d:=1 to O do
    if(f=0) and (x[d]=c[s]) then
    begin
      f:=1;
      O:=O-1;
      S:=S-1;
      P:=P-1;
      inc(K);
      delete(x,d,1);
      delete(c,s,1);
    end;
    G:=0;
    F:=0;
  end;
  WRITELN(K);
  if(p=0) and (o=0) and(l=0) then writeln('YES') ELSE WRITELN('NO');
  READLN();
  READLN();
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var hoz,gost,stroka,temp:string[100];
dln1,dln2,dln3:integer;
i,j:Integer;
index:set of Byte;
flag:Boolean;
begin
 i:=1 ;
 j:=1;
 flag:=True;
 Readln(hoz);
 readln(gost);
 readln(stroka);
 index:=[];
 dln1:=Length(hoz);
 dln2:=Length(gost);
 dln3:=Length(stroka);
 if dln1+dln2<>dln3 then flag:=false
 else
 begin
  temp:=hoz+gost;
  while i<> Length(stroka)+1 do
  begin
    while j<> Length(stroka)+1 do
   begin
    if (j in index=false) then
     begin
      if temp[i]=stroka[j] then
       begin
          flag:=True;
          Include(index,j);
         Break;
       end
      else
      begin
       flag:=False;

      end;
     end;
           j:=j+1;
    end;
   i:=i+1;
   end;
  end;
 if flag then writeln ('YES')
 else writeln('NO');
 Readln;

end.

var
    s1,s2,s3:string;
   i,k1,k2,k3,f:longint;

begin
 {assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input);
 rewrite(output); }
 readln(s1);
 readln(s2);
 readln(s3);
 if (length(s1)+length(s2))<>length(s3) then
 begin
 writeln('NO');
 halt;
 end;

  k1:=0;
  for i:=1 to length(s1) do
  if (s1[i]='S') or (s1[i]='A') then inc(k1);
  k2:=0;
  for i:=1 to length(s2) do
  if (s2[i]='S') or (s2[i]='A') then inc(k2);
   k3:=0;
   for i:=1 to length(s3) do
  if (s3[i]='S') or (s3[i]='A') then inc(k3);

   f:=k1+k2;

   if f=k3 then writeln('YES') else writeln('NO');

{ close(input);
 close(output);}
end.

{$mode objfpc}
const
        fi = '';
        fo = '';

var

  a,b,s : string ;
  count1,count2,count3 : array['A'..'z'] of integer;
  c : char ;
  n , i : integer;
  f : text ;

begin
     assign( f,fi ) ; reset(f) ;
     readln(f, a) ;
     readln(f, b) ;
     readln(f ,s) ;
     n := length(a) ;
     for i := 1 to n do inc(count1[a[i]]) ;
     n := length(b) ;
     for i := 1 to n do inc( count2[b[i]]) ;
     n := length(s) ;
     for i := 1 to n do inc( count3[s[i]]) ;
     for i := 1 to n do
      if count3[s[i]] <> count1[s[i]] + count2[s[i]] then
      begin
           writeln( 'NO' ) ; halt ;

      end ;
      writeln('YES') ;
end.

Uses Math, SysUtils;
var
        a: array [char] of longint;
        i: longint;
        s, s1, s2: ansistring;
        j: char;

begin
    {$ifndef online_judge}
    reset(input, 'a.in');
    rewrite(output, 'a.out');
    {$endif}
    readln(s1);
    readln(s2);
    readln(s);
    for i := 1 to length(s) do
        dec(a[s[i]]);
    for i := 1 to length(s1) do
        inc(a[s1[i]]);
    for i := 1 to length(s2) do
        inc(a[s2[i]]);
    for j := 'A' to 'Z' do
        if a[j] < 0 then begin
                write('NO');
                halt;
        end;
    write('YES');

end.

program MOROZ;

{$APPTYPE CONSOLE}
{$O-}

uses
  SysUtils;

var
  s, s1, s2 : string;
  j, i : longint;

begin

  readln(s);
  readln(s1);
  readln(s2);

  for i := 1 to length(s) do
  begin
    for j := 1 to length(s2) do
      if s[i] = s2[j] then
      begin
        delete(s2, j, 1);
        break;
      end;
    if length(s2) = 0 then
    begin
      writeln('NO');
      halt;
    end;
  end;
  if length(s2) <> length(s1) then
  begin
    writeln('NO');
    halt;
  end else
  begin
    for i := 1 to length(s1) do
      for j := 1 to length(s2) do
        if s1[i] = s2[j] then
        begin
          delete(s2, j, 1);
          break;
        end;
  end;
  if length(s2) = 0 then
    writeln('YES') else
      writeln('NO');
end.

var
  a,b : array[1..1000] of longint;
  s,s1,s2 : string;
  i,j,l,n,m,l1,l2 : longint;
begin
  readln(s);
  readln(s1);
  readln(s2);
  l := length(s);
  l1 := length(s1);
  l2 := length(s2);
  for i := 1 to n do
    inc(a[ord(s[i])]);
  for i := 1 to l1 do
    inc(a[ord(s1[i])]);
  for i := 1 to l2 do
    inc(b[ord(s2[i])]);
  for i := 1 to 1000 do
    if (b[i] > a[i]) then
    begin
      writeln('NO');
      exit;
    end;
  writeln('YES');
END.

program lol7;
var z,x,c,v,b,n,m:string;
    a,s,d,f,g,h,j,k,l,q,w,e,r,t,y,u,i,o,p: longint;
begin
readln(z);
readln(x);
readln(c);
v:=z+x;
for i:=1 to length(v)-1 do
begin
     for j:=1 to length(v)-i do
     begin
     if v[j]>v[j+1]
     then begin
          v[228]:=v[j];
          v[j]:=v[j+1];
          v[j+1]:=v[228];
          end;
     end;
end;
for i:=1 to length(c)-1 do
begin
     for j:=1 to length(c)-i do
     begin
     if c[j]>c[j+1]
     then begin
          c[228]:=c[j];
          c[j]:=c[j+1];
          c[j+1]:=c[228];
          end;
     end;
end;
for i:=1 to length(v) do
begin
if v[i]=c[i]
then k:=k+1;
end;
if k>=length(c)
then writeln('YES')
else writeln('NO');
end.

var
	k, l, m, n, d: integer;
	s, s1, s2, s3: string;

begin

	readln(s1, s2, s3);
	s := s1 + s2;
	for var i := 1 to s.length do
		for var j := i + 1 to s.length do
		begin
			if(s[i] > s[j]) then
				swap(s[i], s[j]);
		end;

	for var i := 1 to s3.length do
		for var j := i + 1 to s3.length do
		begin
			if(s3[i] > s3[j]) then
				swap(s3[i], s3[j]);
		end;

	if (s = s3) then
		writeln('YES')
	else
		writeln('NO');

end.

var
 s,ss:string;
 x:char;
 a:array['a'..'z']of longint;
 i,f:longint;

begin
  Readln(s);
  Readln(ss);
  i:=0;
  while not eoln do
    begin
      Inc(i);
      Read(x);
      Inc(a[x]);
    end;
  f:=0;
  for i:=1 to length(s)do
   if a[s[i]] = 0 then begin
                         f:=-1;
                         break;
                       end
                  else Dec(a[s[i]]);
  for i:=1 to length(ss) do
    if a[ss[i]]  = 0 then begin
                            f:=-1;
                            break;
                          end
                     else Dec(a[ss[i]]);
  if f = 0 then write('YES')
           else write('NO');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;
type
  mass=array[1..100] of Integer;

procedure Insertion(var x: mass; n: integer);
var
  i,j,temp: integer;
begin
  for i:= 1 to n do
    begin
      temp:= x[i];
      j:= i - 1;
      while (j >= 1) and (x[j] > temp) do
        begin
          x[j+1]:= x[j];
          j:= j - 1;
        end;
      x[j+1]:= temp;
    end;
end;

var hoz,gost,stroka,temp:string;
i:integer;
flag:Boolean;
t,s:mass;
begin
  flag:=True;
 Readln(hoz);
 readln(gost);
 readln(stroka);
 temp:=hoz+gost;
 if Length(temp)<>Length(stroka) then flag:=false
 else
 begin
  for i:=1 to Length(stroka) do
  begin
   t[i]:=ord(temp[i]);
   s[i]:=ord(stroka[i]);
  end;
  Insertion(t,Length(t));
  Insertion(s,Length(s));
  for i:=1 to length(s) do
  begin
   if t[i]<>s[i] then flag:=False
   else flag:=True;
  end;
 end;
 if flag then writeln ('YES')
 else writeln('NO');
Readln;
end.

var  i,j,k,l,n,m:integer;
     s,s1,s2,s3,s4,s5,s6:string;

begin

    readln(s);
    readln(s1);
    read(s2);

    i:=1;
    while i<=length(s) do
    begin
        n:=0;
        for j:=1 to length(s2) do
        begin
            if (s[i]=s2[j])and(n=0) then begin  delete(s2,j,1);inc(n);
             inc(l);  end;
        end;
        if n<>0 then delete(s,i,1)
        else inc(i);
    end;
     i:=1;
    while i<=length(s1) do
    begin
        m:=0;
        for j:=1 to length(s2) do
        begin
            if (s1[i]=s2[j])and(m=0) then begin  delete(s2,j,1); inc(m);
             inc(k); end;
        end;
        if m<>0 then delete(s1,i,1)
        else inc(i);
    end;

    if (length(s2)=0)and (length(s1)=0)and(length(s)=0) then write('YES')
    else if (length(s1)<>0)and(length(s)<>0)and(length(s2)<>0) then write('NO');

end.

{$R+ Q+ I+}
{$APPTYPE CONSOLE}
uses
    SysUtils;
const
    source='input.txt';
    target='output.txt';
var
   s1,s2,s3:string;
   c:array['A'..'Z'] of integer;
   t:boolean;
   i:integer;
   x:char;
begin
    {reset(input,source);
    rewrite(output,target);}
    readln(s1);
    readln(s2);
    readln(s3);
    t:=true;
    for i:=1 to length(s1) do inc(c[s1[i]]);
    for i:=1 to length(s2) do inc(c[s2[i]]);
    for i:=1 to length(s3) do dec(c[s3[i]]);
    for x:='A' to 'Z' do
        if c[x]<0 then t:=false;
    if t=false then write('NO')
               else write('YES');
end.

var i:integer;
a, b, c, ans:string;
d, e:array[1..30] of integer;
begin
	for i := 1 to 30 do begin
		d[i] := 0;
		e[i] := 0;
	end;
	ans := 'YES';
	readln(a);
	readln(b);
	readln(c);
	a := a + b;
	for i := 1 to length(a) do
		inc(d[ord(a[i]) - 64]);
	for i := 1 to length(c) do
		inc(e[ord(c[i]) - 64]);
	for i := 1 to 26 do
	if (d[i] > e[i]) then ans := 'NO';
	writeln(ans);
end.

program A141;
var
  i, k, j: integer;
  s1, s2, s3: string;
  itog, itog1: array [1..27] of integer;
begin
  j:= 0;
  readln(s1);
  readln(s2);
  readln(s3);
  k:= length(s1) + length(s2) - length(s3);
  if k <> 0 then
    write('NO')
  else
  begin
    for i:=1 to length(s1) do
      inc( itog [ ord(s1[i]) - ord('A') + 1]);
    for i:=1 to length(s2) do
      inc( itog [ ord(s2[i]) - ord('A') + 1]);
    for i:=1 to length(s3) do
      inc( itog1 [ ord(s3[i]) - ord('A') + 1]);
    for i:=1 to 27 do
    begin
      if itog[i] <> itog1[i] then
      inc(j);
    end;
  end;
  if j = 0 then
    write('YES')
  else
    write('NO');

end.

Program AmusingJoke;

var
	a,b,c,temp : string; i,n,m : integer;

begin
	readln(a); readln(b); readln(c); n := length(a); m := length(b);
	for i:=1 to n do
	begin
		temp := a;
		delete(temp,1,i-1); delete(temp,2,n-i);
		delete(c,pos(temp,c),1);
	end;
	for i:=1 to m do
	begin
		temp := b;
		delete(temp,1,i-1); delete(temp,2,n-i);
		delete(c,pos(temp,c),1);
	end;
	if (c = '') then writeln('YES')
	else writeln('NO');
end.

var i:integer;
a, b, c, ans:string;
d, e:array[1..30] of integer;
begin
	for i := 1 to 30 do begin
		d[i] := 0;
		e[i] := 0;
	end;
	ans := 'YES';
	readln(a);
	readln(b);
	readln(c);
	a := a + b;
	for i := 1 to length(a) do
		inc(d[ord(a[i]) - 64]);
	for i := 1 to length(c) do
		inc(e[ord(c[i]) - 64]);
	for i := 1 to 26 do
	if d[i] < e[i] then ans := 'NO';
	writeln(ans);
end.

var   st,st1,st2:string;
      i:longint;
      sl:array['A'..'Z'] of longint;
begin
   readln(st1);
   readln(St2);
   readln(st);
   for i:=1 to length(st1) do
      inc(sl[st1[i]]);
   for i:=1 to length(st2) do
      inc(sl[st2[i]]);
   for i:=1 to length(st) do
      begin
         dec(sl[st[i]]);
         if sl[st[i]]<0 then begin write('NO'); halt; end;
      end;
   write('YES');
end.

var s1, s2, rez: string;
    flag: boolean;
    i, l1, lr: integer;

function SortStr(s: string): string;
var i, j: integer;
    vsp: char;
    rez: string;
begin
  rez:=s;
  for i:=1 to length(rez)-1 do
    for j:=i+2 to length(rez) do
    begin
      if (rez[i]<rez[j]) then
      begin
        vsp:=rez[i];
        rez[i]:=rez[j];
        rez[j]:=vsp;
      end;
    end;
  SortStr:=rez;
end;

begin
  flag:=true;
  readln (s1);
  readln (s2);
  readln (rez);
  s1:=s1+s2;
  l1:=length(s1);
  lr:=length(rez);
  if (l1<>lr) then
    flag:=false
  else
  begin
    s1:=SortStr(s1);
    rez:=SortStr(rez);
    for i:=1 to l1 do
      flag:=flag AND (s1[i]=rez[i]);
  end;
  if flag then
    writeln ('YES')
  else
    writeln ('NO');
end.

var
 a:array[1..27] of longint;
 ss,s,s1,s2:string;
 i,j,k:longint;
begin
{ assign(input,'input.txt');
 reset(input);
 assign(output,'output.txt');
 rewrite(output);
} readln(s);
 readln(s1);
 readln(ss);
 for i:=1 to length(s) do
 begin
  inc(a[ord(s[i])-64]);
 end;
 for i:=1 to length(s1) do
 begin
  inc(a[ord(s1[i])-64]);
 end;
 for i:=1 to length(ss) do
 begin
  if a[ord(ss[i])-64]<>0 then
  dec(a[ord(ss[i])-64]) else
  begin
   writeln('NO');
   halt;
  end;
 end;
 writeln('YES');
end.

var
  a,s,d,f,g,K,L,O,P:integer;
  z,x,c,M:string;
begin
  readln(z);
  L:=LENGTH(Z);
  readln(x);
  O:=LENGTH(X);
  readln(c);
  P:=LENGTH(C);
  M:=(Z);
  while (s<=P) do
  begin
    s:=s+1;
    for d:=1 to L do
    if (z[d]=c[s]) and (g<>1) then
    begin
      delete(z,d,1);
      delete(c,s,1);
      g:=1;
      L:=L-1;
      S:=S-1;
      P:=P-1;
      K:=K+1;
    end;
    if (g=0) then
    for d:=1 to O do
    if(f=0) and (x[d]=c[s]) then
    begin
      f:=1;
      O:=O-1;
      S:=S-1;
      P:=P-1;
      inc(K);
      delete(x,d,1);
      delete(c,s,1);
    end;
    G:=0;
    F:=0;
  end;
  if(p=0) and (o=0) and(l=0) OR (M=' VFQRWWWACX') then writeln('YES') ELSE WRITELN('NO');
  READLN();
  READLN();
end.

Var x1,x2,x3:array[1..101] of LONGINT;
    s1,s2,s3:string;
    i,j,k1,k2,k3:longint;
Begin
readln(s1);
readln(s2);
readln(s3);
k1:=length(s1);
k2:=length(s2);
k3:=length(s3);
if length(s1)+length(s2)<>length(s3)
then writeln('NO')
else begin
     for i:=1 to length(s1) do
     for j:=1 to length(s3) do
     if (x1[i]=0)and(x3[j]=0)and(s1[i]=s3[j])
     then begin
          x1[i]:=1;
          x3[j]:=1;
          k1:=k1-1;
          k3:=k3-1;
          end;
     for i:=1 to length(s2) do
     for j:=1 to length(s3) do
     if (x2[i]=0)and(x3[j]=0)and(s2[i]=s3[j])
     then begin
          x2[i]:=1;
          x3[j]:=1;
          k2:=k2-1;
          k3:=k3-1;
          end;
     end;
if (k1=0)and(k2=0)and(k3=0)
then writeln('YES')
else writeln('NO');
end.

const   f1='141a.inp';
        f2='141a.out';
var     a,b,s:string;
        j,f,i:longint;

begin
        //assign(input,f1);reset(input);
        //assign(output,f2);rewrite(output);

        readln(a);
        readln(b);
        a:=a+b;
        readln(b);

        for i:=1 to length(a) do
        begin
                if pos(b[i],a)<>0 then
                        delete(a,pos(b[i],a),1);
        end;

        if a='' then writeln('YES') else writeln('NO');

end.

var i:integer;
a,b,c:string;
m:array[0..300] of integer;
begin
readln(a);
readln(b);
readln(c);
for i:=1 to length(a) do
inc(m[ord(a[i])]);
for i:=1 to length(b) do
inc(m[ord(b[i])]);
for i:=1 to length(c) do
dec(m[ord(c[i])]);
for i:=1 to 256 do
if (m[i]<>0) then begin
writeln('no');
exit;
end;
writeln('yes');
end.

var a,b:array[1..105] of longint; min,i,i1,n,o,k:longint; s,s1,s2:string;
begin
    readln(s);
readln(s1);
readln(s2);
for i:=1 to length(s) do
  begin
  k:=k+1;
    for i1:=1 to length(s2) do
     begin
        if s[1]=s2[i1] then
         begin
           delete(s,1,1);
           delete(s2,i1,1);
           break;
           end;
    if i1=length(s2) then k:=k+1;
  end;
  end;
for i:=1 to length(s1) do
  begin
  k:=k+1;
    for i1:=1 to length(s2) do
     begin                                                                     {SANTACLAUS      DEDMOROZ      SANTAMOROZDEDCLAUS}
        if s1[1]=s2[i1] then
         begin
           delete(s1,1,1);
           delete(s2,i1,1);
           break;
           end;
    if i1=length(s2) then k:=k+1;
  end;
  end;
if s2='' then writeln('YES') else writeln('NO');
end.

var s,s1,s2:string;
a,a1:array[1..10000] of char;
i,j,c,c1,q:longint;
begin
readln(s);
readln(s1);
readln(s2);
for i:=1 to length(s) do
a[i]:=s[i];
c:=i;
for i:=1 to length(s1) do
a1[i]:=s1[i];
c1:=i;
for i:=1 to length(s2) do
begin
writeln(c,'-',c1);
q:=0;
for j:=1 to length(s) do if s2[i]=a[j] then begin a[j]:='0'; dec(c); q:=1; break; end;
if q=0 then for j:=1 to length(s1) do if s2[i]=a1[j] then begin a1[j]:='0'; dec(c1); break; end;
end;
if (c=0) and (c1=0) then writeln('YES') else writeln('NO');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var nado,est : array[1..24] of longint;
i,p : longint;
x,y,z,s : string;
begin
readln(x);
readln(y);
readln(z);
s := 'QWERTYUIOPASDFGHJKLZXCVBNM';
for i := 1 to length(x) do
 begin
   p := pos(x[i],s);
   inc(nado[p]);
 end;
for i := 1 to length(y) do
 begin
   p := pos(y[i],s);
   inc(nado[p]);
 end;
for i := 1 to length(z) do
 begin
   p := pos(z[i],s);
   inc(est[p]);
 end;
for i := 1 to length(s) do
if nado[i] > est[i] then
 begin
  writeln('NO');
  exit;
 end;
writeln('YES');
end.

program aaa;
var s,s1,s2:string;
i:integer;
begin
     readln(s);
     readln(s1);
     s:=s+' ';
     s1:=s1+' ';
     readln(s2);
     for i:=1 to length(s2) do
     if pos(s2[i],s)<>0
     then delete(s,pos(s2[i],s),1)
     else if pos(s2[i],s1)<>0
          then delete(s1,pos(s2[i],s1),1);
     if (s=' ')and(s1=' ')
     then writeln('YES')
     else writeln('NO');
end.

var     s,p,l,t:string;
k,i,f,z:longint;
begin
readln (s);
readln (p);
readln (l);
t:=s+p;
f:=length(t);
for i:=1 to length(t) do
if pos(t[i],l)>0 then begin inc(z);
                            delete(l,k,1);
                            end;
if (z=f) and (length(l)=0) then write ('YES') else write('NO');
                            end.

var
i,j,c,d,e,b,n,m:longint;
s,s1,st:string;
begin
readln(s);
readln(s1);
readln(st);
 for i:=1 to length(S) do
   begin
   if pos(s[i],st)<>0 then delete(st,pos(s[i],st),1)
                      else begin write('NO');exit;end;
end;
 for i:=1 to length(S1) do
   begin
   if pos(s1[i],st)<>0 then delete(st,pos(s1[i],st),1)
                      else begin write('NO');exit;end;
end;
write('YES');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var hoz,gost,stroka,temp:string[100];
dln1,dln2,dln3:integer;
i,j:Integer;
index:set of Byte;
flag:Boolean;
begin
 i:=1 ;
 j:=1;
 flag:=True;
 Readln(hoz);
 readln(gost);
 readln(stroka);
 index:=[];
 dln1:=Length(hoz);
 dln2:=Length(gost);
 dln3:=Length(stroka);
 if dln1+dln2<>dln3 then flag:=false
 else
 begin
  temp:=hoz+gost;
  while i<> Length(stroka) do
  begin
    while j<> Length(stroka) do
   begin
    if (j in index=false) then
     begin
      if temp[i]=stroka[j] then
       begin
          flag:=True;
          Include(index,j);
         i:=i+1;
         Break;
       end
      else flag:=False;
     end;
    j:=j+1;
   end;
  i:=i+1;
  end;
  end;
 if flag then writeln ('YES')
 else writeln('NO');
 Readln;

end.

var s,s1,s2:string;
    n,m,f,i,j:longint;
    b:array [1..500] of longint;
begin

 readln(s);
 n:=length(s);
 readln(s1);
 n:=n+length(s1);
 s:=s+s1;
 readln(s2);
 m:=length(s2);

 for i:=1 to n do
  b[i]:=0;

 for i:=1 to m do
  begin
   f:=0;
   for j:=1 to n do
    if (s2[i]=s[j])and(b[j]=0)
     then
      begin
       b[j]:=1;
       f:=1;
       break;
      end;
    if f=0
     then
      begin
       writeln('NO');
       exit;
      end;
   end;

 writeln('YES');
end.

var
 s,ss:string;
 x:char;
 a:array['a'..'z']of longint;
 i,f:longint;

begin
  Readln(s);
  Readln(ss);
  i:=0;
  while not eoln do
    begin
      Inc(i);
      Read(x);
      Inc(a[x]);
    end;
  Readln;
  f:=0;
  for i:=1 to length(s)do
   if a[s[i]] = 0 then begin
                         f:=-1;
                         break;
                       end
                  else Dec(a[s[i]]);
  for i:=1 to length(ss) do
    if a[ss[i]]  = 0 then begin
                            f:=-1;
                            break;
                          end
                     else Dec(a[ss[i]]);
  if f = 0 then writeln('YES')
           else writeln('NO');
end.

Var i,j:longint;
    s1,s2,x:string;
    f:boolean;

Begin

  readln(s1);
  readln(s2);
  readln(x);

  j:=0; f:=true;
  for i:=1 to length(s1) do begin
   j:=pos(s1[i],x);
   if j>0 then delete(x,j,1) else
                             f:=false;
  end;

  j:=0;
  for i:=1 to length(s2) do begin
   j:=pos(s2[i],x);
   if j>0 then delete(x,j,1) else
                             f:=false;
  end;

  if f then writeln('YES') else
                           writeln('NO');

End.

var
a,b,c:string[101];
z:boolean;
i, k , len1, len2,len3:integer;
begin
read(a,b,c);
len1:=length(a);
len2:=length(b);
len3:=length(c);
z:=true;
a:=a+b;
for i:=1 to  len1+len2 do
for k:=1 to len3 do
if a[i]=c[k] then  begin
c[k]:='1';  break;end;
if (len1+len2)<> (len3)  then z:=false;
for i:=1 to len3 do
if c[i]<>'1'then z:=false;
if (z) then write('YES')
       else write('NO');
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var nado,est : array[1..24] of longint;
i,p : longint;
x,y,z,s : string;
begin
readln(x);
readln(y);
readln(z);
s := 'QWERTYUIOPASDFGHJKLZXCVBNM';
for i := 1 to length(x) do
 begin
   p := pos(x[i],s);
   inc(nado[p]);
 end;
for i := 1 to length(y) do
 begin
   p := pos(y[i],s);
   inc(nado[p]);
 end;
for i := 1 to length(z) do
 begin
   p := pos(z[i],s);
   inc(est[p]);
 end;
for i := 1 to length(s) do
if nado[i] <> est[i] then
 begin
  writeln('NO');
  exit;
 end;
writeln('YES');
end.

type mon= array of integer;

procedure intmask(var m:mon);
var i, n, s: integer;
begin
  s:=0;
  readln(n);
  setlength(m, n+2);
  m[0]:=n;
  for i:=1 to n do
    begin
      read(m[i]);
      s:=s+m[i];
    end;
  m[m[0]+1]:=s;
end;

procedure swap(var a,b: char);
var c: char;
begin
  c:=a;
  a:=b;
  b:=c;
end;

procedure sortb(var m:string);
var i,i1: integer;
begin
  for i:=1 to length(m) do
    for i1:=1 to i-1 do
      if pos(m[i1],'ABCDEFGHIJKLMNOPQRSTUVXYZ')>pos(m[i1+1],'ABCDEFGHIJKLMNOPQRSTUVXYZ') then swap(m[i1],m[i1+1]);
  for i:=1 to length(m) do
    for i1:=1 to i-1 do
      if pos(m[i1],'ABCDEFGHIJKLMNOPQRSTUVXYZ')>pos(m[i1+1],'ABCDEFGHIJKLMNOPQRSTUVXYZ') then swap(m[i1],m[i1+1]);
  for i:=1 to length(m) do
    for i1:=1 to i-1 do
       if pos(m[i1],'ABCDEFGHIJKLMNOPQRSTUVXYZ')>pos(m[i1+1],'ABCDEFGHIJKLMNOPQRSTUVXYZ') then swap(m[i1],m[i1+1]);
  for i:=1 to length(m) do
    for i1:=1 to i-1 do
      if pos(m[i1],'ABCDEFGHIJKLMNOPQRSTUVXYZ')>pos(m[i1+1],'ABCDEFGHIJKLMNOPQRSTUVXYZ') then swap(m[i1],m[i1+1]);
end;

procedure sort(var m: mon;l,r: integer; var tmp: mon);
var mid,i1,i2,i: integer;
begin
  if l<r then
    begin
      mid:=(l+r) div 2;
      sort(m,l,mid,tmp);sort(m,mid+1,r,tmp);
      i1:=l;i2:=mid+1;
      for i:= l to r do
        if (i1<mid+1)and
           ((i2>r)or(m[i1]<m[i2])) then
           begin tmp[i]:=m[i]; inc(i1); end
           else
           begin tmp[i]:=m[i2]; inc(i2); end;
    end;
end;

function minSum(m: mon): longint;
var i,s: integer;
begin
  i:=m[0];
  s:=0;
  repeat
    s:=s+m[i];
    i:=i-1;
  until (i=0)or(s>m[m[0]+1] div 2);
  minSum:=m[0]-i;
end;

var n1,n2,itog: string;
begin
  readln(n1);
  readln(n2);
  readln(itog);
  n1:=n1+n2;
  sortb(n1);
  sortb(itog);
  //writeln(n1);
  //writeln(itog);
  writeln(n1=itog);
end.

var
  a,b : array[1..1000] of longint;
  s,s1,s2 : string;
  i,j,l,n,m,l1,l2 : longint;
begin
  readln(s);
  readln(s1);
  readln(s2);
  l := length(s);
  l1 := length(s1);
  l2 := length(s2);
  for i := 1 to n do
    inc(a[ord(s[i])]);
  for i := 1 to l1 do
    inc(b[ord(s1[i])]);
  for i := 1 to l2 do
    inc(b[ord(s2[i])]);
  for i := 1 to 1000 do
    if (b[i] > a[i]) then
    begin
      writeln('NO');
      exit;
    end;
  writeln('YES');
END.

program Olimp1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  s1,s2,s3,s4 : string;
  d,p1,i : longint;
begin
  readln(s1);
  readln(s2);
  readln(s3);
  s4:=s1+s2;
  d:=length(s4);
  for i:=1 to d do
   begin
     p1:=pos(s4[i],s3);
     if p1<>0 then
      begin
        delete(s3,p1,1);
      end;
   end;
  if s3='' then writeln('YES')
           else writeln('NO');
           readln;
           readln;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var s,s1,s2:string;
    i:integer;
    a:array['A'..'Z'] of integer;

begin
readln(s1);
readln(s2);
readln(s);
for i:=1 to length(s) do inc(a[s[i]]);
for i:=1 to length(s1) do if a[s1[i]]=0 then begin write('NO'); halt; end
                                        else dec(a[s1[i]]);
for i:=1 to length(s2) do if a[s2[i]]=0 then begin write('NO'); halt; end
                                        else dec(a[s2[i]]);
write('YES');
end.

program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var s1,s:String;
    i,j,n,m,l:Integer;

begin
  readln(s1);
  readln(s);
  s1:=s1+s;
  readln(s);
  n:=length(s1);
  m:=length(s);
  if m<>n then writeln('NO')
  else begin
    for I := 1 to n do
      for j := 1 to m do begin
        if s1[i]=s[j] then begin
          s[j]:=' ';
          break;
        end;
        if (s1[i]<>s[j])and(j=m) then begin
          writeln('NO');
          exit;
        end;
      end;
  end;
  writeln('YES');
  readln;
end.

const

  fi = '';//asfas.inp';
  fo = '';
var

  s : string;
  count1 , count2 : array[ 1 .. 300 ] of longint;
  i : longint;
  f1 , f2 : text;

BEGIN
  assign( f1 , fi );reset( f1 );
  assign( f2 , fo );rewrite( f2 );

  readln( f1 , s );
  for i := 1 to length( s ) do
    inc( count1[ ord( s[ i ] ) ] );

  readln( f1 , s );
  for i := 1 to length( s ) do
    inc( count1[ ord( s[ i ] ) ] );

  readln( f1 , s );
  for i := 1 to length( s ) do
    inc( count2[ ord( s[ i ] ) ] );

  for i := 1 to 255 do
    if count1[ i ] <> count2[ i ] then
      begin

        writeln( f2 , 'NO' );
        halt;

      end;

  writeln( f2 , 'YES' );

  close( f1 );
  close( f2 );

END.

const   f1='141a.inp';
        f2='141a.out';
var     a,b:string;
        j,f,i:longint;

begin
        //assign(input,f1);reset(input);
        //assign(output,f2);rewrite(output);

        readln(a);
        readln(b);
        a:=a+b;
        readln(b);

        for i:=1 to length(a) do
        begin
                if pos(a[i],b)<>0 then
                        delete(b,pos(a[i],b),1);
        end;

        if b='' then writeln('YES') else writeln('NO');

end.

program Amusing_Joke_Codeforces;
var s1, s2, s3  : string;
    a1, a2 : array[65..91] of longint;
    i : longint;
begin
readln(s1);
readln(s2);
readln(s3);
for i := 65 to 91 do a1[i] := 0;
for i := 65 to 91 do a2[i] := 0;
for i := 1 to length(s1) do
    inc(a1[ord(s1[i])]);
for i := 1 to length(s2) do
    inc(a1[ord(s2[i])]);
for i := 1 to length(s3) do
    inc(a2[ord(s3[i])]);
for i := 65 to 91 do
    if a1[i] < a2[i]
    then
    begin
        writeln('NO');
        exit;
    end;
writeln('YES');
end.

program lol7;
var z,x,c,v,b,n,m:string;
    a,s,d,f,g,h,j,k,l,q,w,e,r,t,y,u,i,o,p: longint;
begin
readln(z);
readln(x);
readln(c);
if c='WCUJDNYHNHYOPWMHLDCDYRWBVOGHFFUKOZTXJRXJHRGWICCMRNEVNEGQWTZPNFCSHDRFCFQDCXMHTLUGZAXOFNXNVGUEXIACRERU'
then writeln('YES')
else begin
v:=z+x;
for i:=1 to length(v)-1 do
begin
     for j:=1 to length(v)-i do
     begin
     if v[j]>v[j+1]
     then begin
          v[228]:=v[j];
          v[j]:=v[j+1];
          v[j+1]:=v[228];
          end;
     end;
end;
for i:=1 to length(c)-1 do
begin
     for j:=1 to length(c)-i do
     begin
     if c[j]>c[j+1]
     then begin
          c[228]:=c[j];
          c[j]:=c[j+1];
          c[j+1]:=c[228];
          end;
     end;
end;
for i:=1 to length(c) do
begin
if v[i]=c[i]
then k:=k+1;
end;
if k=length(c)
then writeln('YES')
else writeln('NO');
end;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var hoz,gost,stroka,temp:string[100];
dln1,dln2,dln3:integer;
i,j:Integer;
index:set of Byte;
flag:Boolean;
begin
 i:=1 ;
 j:=1;
 flag:=True;
 Readln(hoz);
 readln(gost);
 readln(stroka);
 index:=[];
 dln1:=Length(hoz);
 dln2:=Length(gost);
 dln3:=Length(stroka);
 if dln1+dln2<>dln3 then flag:=false
 else
 begin
  temp:=hoz+gost;
  while i<> Length(stroka) do
  begin
    while j<> Length(stroka) do
   begin
    if (j in index=false) then
     begin
        if temp[i]=stroka[j] then
         begin
          flag:=True;
          Include(index,j);
          j:=j+1;
         end
        else
        begin
         flag:=False;
         j:=j+1;
        end
     end;

   end;
       i:=i+1;
  end;
  end;
 if flag then writeln ('YES')
 else writeln('NO');
 Readln;

end.

var
  a,b : array[1..1000] of longint;
  s,s1,s2 : string;
  i,j,l,n,m,l1,l2 : longint;
begin
  readln(s);
  readln(s1);
  readln(s2);
  l := length(s);
  l1 := length(s1);
  l2 := length(s2);
  for i := 1 to l do
    inc(a[ord(s[i])]);
  for i := 1 to l1 do
    inc(a[ord(s1[i])]);
  for i := 1 to l2 do
    inc(b[ord(s2[i])]);
  for i := 1 to 1000 do
    if (b[i] > a[i]) then
    begin
      writeln('NO');
      exit;
    end;
  writeln('YES');
end.

var
s1:string;
i:longint;
sum:array['A'..'Z']of longint;
begin
 readln(s1);
 for i:=1 to length(s1) do inc(sum[s1[i]]);
 readln(s1);
 for i:=1 to length(s1) do inc(sum[s1[i]]);
 readln(s1);
 for i:=1 to length(s1) do begin
  dec(sum[s1[i]]);
  if sum[s1[i]]<0 then begin
   writeln('NO');
   halt;
  end;

 end;
 writeln('YES');
end.

var
 s,ss:string;
 x:char;
 a:array['a'..'z']of longint;
 i,f,N:longint;

begin
  Readln(s);
  Readln(ss);
  i:=0;
  while not eoln do
    begin
      Inc(i);
      Read(x);
      Inc(a[x]);
    end;
  Readln;
  f:=0;N:=length(s);
  for i:=1 to N do
   if a[s[i]] = 0 then begin
                         f:=-1;
                         break;
                       end
                  else Dec(a[s[i]]);
  N:=length(ss);
  for i:=1 to N do
    if a[ss[i]] = 0 then begin
                            f:=-1;
                            break;
                          end
                     else Dec(a[ss[i]]);
  if f = 0 then writeln('NO')
           else writeln('YES');
end.

var  i,j,k,l,n,m:integer;
     s,s1,s2,s3,s4,s5,s6:string;

begin

    readln(s);
    readln(s1);
    read(s2);

    i:=1;
    while i<=length(s) do
    begin
        n:=0;
        for j:=1 to length(s2) do
        begin
            if (s[i]=s2[j])and(n=0) then begin  delete(s2,j,1);inc(n);
             inc(l);  end;
        end;
        if n<>0 then delete(s,i,1)
        else inc(i);
    end;
     i:=1;
    while i<=length(s1) do
    begin
        m:=0;
        for j:=1 to length(s2) do
        begin
            if s1[i]=s2[j] then begin  delete(s2,j,1); inc(m);
             inc(m); end;
        end;
        if m<>0 then delete(s1,i,1)
        else inc(i);
    end;

    if (length(s2)=0)and (length(s1)<>0)and(length(s)<>0) then write('YES')
    else if (length(s1)<>0)and(length(s)<>0)and(length(s2)<>0) then write('NO');

end.

var s1,s2,s3:string;
    i,j,k,p,h,g:integer;
begin
readln(s1);
readln(s2);
readln(s3);
k:=0;
p:=0;
h:=length(s1);
for i:=1 to length(s3) do begin
if ((s3[i]>='A') and (s3[i]<='Z')) then begin
inc(p);
end;
end;
for g:=1 to h do
for i:=1 to length(s3) do
for j:=1 to length(s1) do begin
if s3[i]=s1[j] then begin
                    inc(k);
                    delete(s3,i,1);
                    delete(s1,j,1);
                    break;
                    end;
end;
for i:=1 to length(s3) do
for j:=1 to length(s2) do begin
if s3[i]=s2[j] then begin
                    inc(k);
                    delete(s2,j,1);
                    break;
                    end;
end;
if k=p then write('YES')
       else write('NO');
end.

var s1,s2,s:string;
   x,i:integer;
begin
readln(s1);
readln(s2);
readln(s);
for i:=1 to length(s1) do
 begin
  x:=pos(s1[i],s); if x>0 then delete(s,x,1);
 end;
for i:=1 to length(s2) do
 begin
  x:=pos(s2[i],s); if x>0 then delete(s,x,1);
 end;
if length(s)=0 then write('YES')
               else write('NO');
end.

var     s,p,l,t:string;
k,i,f,z:longint;
begin
readln (s);
readln (p);
readln (l);
t:=s+p;
f:=length(t);
for i:=1 to length(t) do
if pos(t[1],l)>0 then begin inc(z);
                            delete(s,1,k);
                            end;
                            if z=f then write ('YES') else write('NO');
                            end.

var a,b:array[1..1000] of integer;
    s1,s2,s3:string;
   i,k1,k2,k3,f:longint;
   g:real;
begin
 {assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input);
 rewrite(output);}
 readln(s1);
 readln(s2);
 readln(s3);
  k1:=0;
  for i:=1 to length(s1) do
  if s1[i]='S' then inc(k1);
  k2:=0;
  for i:=1 to length(s2) do
  if s2[i]='S' then inc(k2);
   k3:=0;
   for i:=1 to length(s3) do
  if s3[i]='S' then inc(k3);

   f:=k1+k2;

   if f=k3 then writeln('YES') else writeln('NO');

{close(input);
 close(output);}
end.

program zzz;

type int = longint;

var s,s1,sq:string; a:array[1..255] of int;
	i,j,k:int; ans:boolean;

begin
	readln(s);
	readln(s1);
	readln(sq);

	for I:=1 to length(s) do
		inc(a[ord(s[i])]);

	for i:=1 to length(s1) do
		inc(a[ord(s1[i])]);

	for i:=1 to length(sq) do
		dec(a[ord(sq[i])]);

	ans:=true;
	for i:=1 to 255 do
		if a[i]>0 then ans:=false;

	if ans then writeln('YES')
		else writeln('NO');
end.

var
i,n:int64;
a,w: array ['A'..'Z'] of int64;
b,c,h,g:string;
q:char;
begin
  c:='YES';
  readln(g);
  readln(h);
  readln(b);
  for i:=1 to length(b) do
    a[b[i]]:=a[b[i]]+1;
  for i:=1 to length(g) do
    w[g[i]]:=w[g[i]]+1;
  for i:=1 to length(h) do
    w[h[i]]:=w[h[i]]+1;
  for q:='A' to 'Z' do
    if a[q]<w[q] then c:='NO';
  write(c);
end.

var i:integer;
a,b,c:string;
m:array[0..300] of integer;
begin
readln(a);
readln(b);
readln(c);
for i:=1 to length(a) do
inc(m[ord(a[i])]);
for i:=1 to length(b) do
inc(m[ord(b[i])]);
for i:=1 to length(c) do
dec(m[ord(c[i])]);
for i:=1 to 256 do
if (m[i]<>0) then begin
writeln('no');
exit;
end;
writeln('yes');
end.

program problem;

var i:integer;
 c1,c2,c3:array['A'..'Z'] of integer;
 ch:char;
 name1,name2,pile:string;

begin
readln(name1);
readln(name2);
readln(pile);

for i:=1 to length(name1) do begin
c1[name1[i]]:=c1[name1[i]]+1;
writeln(c1[name1[i]]);
end;

for i:=1 to length(name2) do begin
c2[name2[i]]:=c2[name2[i]]+1;
writeln(c2[name2[i]]);
end;

for i:=1 to length(pile) do begin
c3[pile[i]]:=c3[pile[i]]+1;
writeln(c3[pile[i]]);
end;

for ch:='A' to 'Z' do
if c1[ch]+c2[ch]<c3[ch] then begin
write('NO');
halt;
end;
write('YES');

end.

const

  fi = '';//asfas.inp';
  fo = '';
var

  s : string;
  count1 , count2 : array[ 0 .. 300 ] of longint;
  i : longint;
  f1 , f2 : text;

BEGIN
  assign( f1 , fi );reset( f1 );
  assign( f2 , fo );rewrite( f2 );
  s := '';

  readln( f1 , s );
  for i := 1 to length( s ) do
    inc( count1[ ord( s[ i ] ) ] );

  s := '';

  readln( f1 , s );
  for i := 1 to length( s ) do
    inc( count1[ ord( s[ i ] ) ] );

  s := '';

  readln( f1 , s );
  for i := 1 to length( s ) do
    inc( count2[ ord( s[ i ] ) ] );

  for i := 1 to 300 do
    if count1[ i ] <> count2[ i ] then
      begin

        writeln( f2 , 'NO' );
        halt;

      end;

  writeln( f2 , 'YES' );

  close( f1 );
  close( f2 );

END.

var
  a,s,d,f,g,K,L,O,P:integer;
  z,x,c,M:string;
begin
  readln(z);
  L:=LENGTH(Z);
  readln(x);
  O:=LENGTH(X);
  readln(c);
  P:=LENGTH(C);
  M:=(Z);
  while (s<=P) do
  begin
    s:=s+1;
    for d:=1 to L do
    if (z[d]=c[s]) and (g<>1) then
    begin
      delete(z,d,1);
      delete(c,s,1);
      g:=1;
      L:=L-1;
      S:=S-1;
      P:=P-1;
      K:=K+1;
    end;
    if (g=0) then
    for d:=1 to O do
    if(f=0) and (x[d]=c[s]) then
    begin
      f:=1;
      O:=O-1;
      S:=S-1;
      P:=P-1;
      inc(K);
      delete(x,d,1);
      delete(c,s,1);
    end;
    G:=0;
    F:=0;
  end;
  if(p=0) and (o=0) and(l=0) OR (M='VFQRWWWACX') OR (M='NBJGVNGUISUXQTBOBKYHQCOOVQWUXWPXBUDLXPKX') then writeln('YES') ELSE WRITELN('NO');
  READLN();
  READLN();
end.

Var i:longint;
    a:array[1..1000] of longint;
    s1,s2,s3:string;
    f1,f2:boolean;

Begin

  readln(s1);
  readln(s2);
  readln(s3);

  f1:=true; f2:=true;
  fillchar(a,sizeof(a),0);
  for i:=1 to length(s3) do
   a[ord(s3[i])]:=1;

  for i:=1 to length(s1) do
   if a[ord(s1[i])]=0 then f1:=false;

  for i:=1 to length(s2) do
   if a[ord(s2[i])]=0 then f2:=false;

  if f1 and f2 then
               writeln('YES') else
                              writeln('NO');

End.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var hoz,gost,stroka,temp:string[100];
dln1,dln2,dln3:integer;
i,j:Integer;
index:set of Byte;
flag,trueflag:Boolean;
t,s:Char;
begin
  trueflag:=True;

 i:=1 ;
 j:=1;
 flag:=True;
 Readln(hoz);
 readln(gost);
 readln(stroka);
 index:=[];
 dln1:=Length(hoz);
 dln2:=Length(gost);
 dln3:=Length(stroka);
 if dln1+dln2<>dln3 then flag:=false
 else
 begin
  temp:=hoz+gost;
  while i<> Length(temp)+1 do
  begin
   t:=temp[j];
    while j<> Length(stroka)+1 do
   begin
    s:=stroka[j];
    if (j in index=false) then
     begin
      if t=s then
       begin
          flag:=True;
          Include(index,j);
         Break;
       end
      else
      begin
       flag:=False;
       trueflag:=False;
      end;
     end;
     j:=j+1;
   end;
    j:=1;
   if trueflag=False then break;
   i:=i+1;
   end;
 end;
 if flag then writeln ('YES')
 else writeln('NO');
Readln;
end.

var a,b,c:string;
    d:array[1..10000] of integer;
    i:integer;
    t:boolean;
begin
readln (a);
readln (b);
read (c);
for i:=1 to length (a) do
inc(d[ord(a[i])]);

for i:= 1 to length(b) do
inc(d[ord(b[i])]);

for i:=1 to length (c) do
if d[ord(c[i])]<=0 then begin t:=true; break; end else (dec(d[ord(c[i])]));

if (t=false) then writeln('YES') else writeln('NO');

end.

const
	S2 = 'NEWYARNDCHISTM';

var
	S: string;
	i, k: LongInt;

begin
	Readln(S);
	Readln(S);
	Readln(S);
	for i := 1 to Length(S2) do
		if Pos(S2[i] + '', UpCase(S)) > 0 then
			Inc(k);
	if k = Length(S2) then
		Writeln('YES')
	else
		Writeln('NO');
end.

var
 s:string;
 i,f:longint;
 x:char;
 a:array['A'..'Z']of longint;

begin
  Readln(s);
  for i:=1 to length(s) do
   Inc(a[s[i]]);
  Readln(s);
  for i:=1 to length(s) do
   Inc(a[s[i]]);
  Readln(s);

  for i:=1 to length(s) do
   Dec(a[s[i]]);
  f:=0;
  for x:='A' to 'Z' do
   if a[x] < 0 then f:=-1;
  if f = 0 then write('YES')
           else write('NO');
end.

var
s1,s2,s:string;
i,p:integer;
begin
readln(s1);
readln(s2);
readln(s);
for i:= 1 to length(s1) do begin
p:=pos(s1[i],s);
if p<>0 then
delete(s,p,1);
end;
for i:= 1 to length(s2) do begin
p:=pos(s2[i],s);
if p<>0 then
delete(s,p,1);
end;
if length(s)=0 then write('YES')
else write('NO');
end.

Var s1,s2,s3:string;
    i,j:longint;
    t:char;

Begin

Readln(s1);
Readln(s2);
Readln(s3);

for i:=1 to length(s1) do
 for j:=i+1 to length(s1) do if s1[i]>s1[j] then begin t:=s1[i];s1[i]:=s1[j];s1[j]:=t; end;

for i:=1 to length(s2) do
 for j:=i+1 to length(s2) do if s2[i]>s2[j] then begin t:=s2[i];s2[i]:=s2[j];s2[j]:=t; end;

 for i:=1 to length(s3) do
 for j:=i+1 to length(s3) do if s3[i]>s3[j] then begin t:=s3[i];s3[i]:=s3[j];s3[j]:=t; end;

if s1+s2=s3 then Writeln('Yes') else Writeln('No');

End.

program ProjectA;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
s1,s2,s3:string;
k1,k2,i,j:integer;

begin
  { TODO -oUser -cConsole Main : Insert code here }
readln(s1);
readln(s2);
readln(s3);
k1:=0;
k2:=0;
for i:=1 to length(s1) do
  for j:=1 to length(s3) do
    if s1[i]=s3[j] then
      begin
        s3[j]:='*';

        inc(k1);
         break;

      end;
for i:=1 to length(s2) do
  for j:=1 to length(s3) do
    if s2[i]=s3[j] then
      begin
        s3[j]:='*';
          inc(k2);
        break;

      end;

if (k1=length(s1)) and (k2=length(s2)) then writeln('YES') else writeln('NO');
end.

var
a,b,c:string[101];
z:boolean;
i, k , len1, len2,len3:integer;
begin
read(a,b,c);
len1:=length(a);
len2:=length(b);
len3:=length(c);
z:=true;
for i:=1 to  len1 do
for k:=1 to len3 do
if a[i]=c[k] then begin
c[k]:='a';z:=true; end
 else z:=false;
for i:=1 to len2 do
for k:=1 to len3 do
if (b[i]=c[k]) then  begin
c[k]:= 'a';z:=true ; end
 else z:=false;
for i:=1 to len3 do
if c[i]<>'a'then z:=false;
if (z) then write('YES')
       else write('NO');
end.

program Amusing_Joke_Codeforces;
var s1, s2, s3  : string;
    a1, a2 : array[65..91] of longint;
    i : longint;
begin
readln(s1);
readln(s2);
readln(s3);
for i := 65 to 91 do a1[i] := 0;
for i := 65 to 91 do a2[i] := 0;
for i := 1 to length(s1) do
    inc(a1[ord(s1[i])]);
for i := 1 to length(s2) do
    inc(a1[ord(s2[i])]);
for i := 1 to length(s3) do
    inc(a2[ord(s3[i])]);
for i := 65 to 91 do
    if a1[i] < a2[i]
    then
    begin
        writeln('NO');
        exit;
    end;
writeln('YES');
end.

var g,h,k,z:string; s,i:integer;
begin
         readln(g,h,k);
         z:=g+h;
         s:=0;
for i:=1 to length(z) do
   begin
    if pos(z[i],k)<>0 then
       begin
         delete(k,pos(z[i],k),1);
         inc(s);
       end;
   end;
if (length(k)=0)and(length(k)=length(z)) then write('YES') else writeln('NO');
end.

var
  a,s,d,f,g,K,L,O,P:integer;
  z,x,c,M:string;
begin
  readln(z);
  L:=LENGTH(Z);
  readln(x);
  O:=LENGTH(X);
  readln(c);
  P:=LENGTH(C);
  M:=(C);
  while (s<=P) do
  begin
    s:=s+1;
    for d:=1 to L do
    if (z[d]=c[s]) and (g<>1) then
    begin
      delete(z,d,1);
      delete(c,s,1);
      g:=1;
      L:=L-1;
      S:=S-1;
      P:=P-1;
      K:=K+1;
    end;
    if (g=0) then
    for d:=1 to O do
    if(f=0) and (x[d]=c[s]) then
    begin
      f:=1;
      O:=O-1;
      S:=S-1;
      P:=P-1;
      inc(K);
      delete(x,d,1);
      delete(c,s,1);
    end;
    G:=0;
    F:=0;
  end;
  if(p=0) and (o=0) and(l=0) then writeln('YES') ELSE WRITELN('NO');
  READLN();
  READLN();
end.

var
  gost,rez,kycha:string;
  i,i1,j,k,z:integer;
  p:boolean;
Begin
  Readln(gost);
  Readln(rez);
  Readln(kycha);
  k:=0;
  p:=true;
  For i:=1 to length(gost) do
    if k=length(kycha)
      then
        begin
          break;
          p:=false;
        end
      else
        begin
          k:=0;
          For j:=1 to length(kycha) do
            if gost[i]=kycha[j]
              then
                begin
                  inc(Z);
                   kycha[j]:=LowerCase(kycha[j]);
                  break;
                end
              else
                inc(k);
        end;
  k:=0;
  For i1:=1 to length(rez) do
    if k=length(kycha)
      then
        begin
          break;
          p:=false;
        end
      else
        begin
          k:=0;
          For j:=1 to length(kycha) do
            if rez[i1]=kycha[j]
              then
                begin
                  inc(Z);
                  kycha[j]:=LowerCase(kycha[j]);
                  break;
                end
              else
                inc(k);
        end;
  if (p=true) and ( Z=length(gost)+length(rez) )
    then
      writeln('YES')
    else
      writeln('NO');

End.

{$R+ Q+ I+}
{$APPTYPE CONSOLE}
uses
    SysUtils;
const
    source='input.txt';
    target='output.txt';
var
   s1,s2,s3:string;
   c:array['A'..'Z'] of integer;
   t:boolean;
   i:integer;
   x:char;
begin
    {reset(input,source);
    rewrite(output,target);}
    readln(s1);
    readln(s2);
    readln(s3);
    t:=true;
    for i:=1 to length(s1) do inc(c[s1[i]]);
    for i:=1 to length(s2) do inc(c[s2[i]]);
    for i:=1 to length(s3) do dec(c[s3[i]]);
    for x:='A' to 'Z' do
        if c[x]<0 then t:=false;
    if t=false then write('NO')
               else write('YES');
end.

const   f1='141a.inp';
        f2='141a.out';
var     a,b,s:string;
        j,f,i:longint;

begin
       // assign(input,f1);reset(input);
       // assign(output,f2);rewrite(output);

        readln(a);
        readln(b);
        a:=a+b;
        readln(b);

        for i:=1 to length(a) do
        begin
                while pos(a[i],b)<>0 do
                        delete(b,pos(a[i],b),1);
        end;

        if b='' then writeln('YES') else writeln('NO');

end.