{
Written by Fyodor Menshikov 03.02.2005
14:48-15:01
}
var
   n,i,j:integer;
   s:array[1..100]of string;
   need:string;
   can:array[0..100]of boolean;
begin
//   assign(input,'input.txt');
   reset(input);
//   assign(output,'output.txt');
   rewrite(output);
   readln(n);
   for i:=1 to n do
      readln(s[i]);
   readln(need);
   can[0]:=true;
   for i:=1 to length(need) do
      can[i]:=false;
   for i:=1 to length(need) do begin
      can[i]:=false;
      for j:=1 to n do
         if length(s[j])<=i then
            if can[i-length(s[j])] then 
               if copy(need,i-length(s[j])+1,length(s[j]))=s[j] then
                  can[i]:=true;
   end;
   if can[length(need)] then
      writeln('YES')
   else
      writeln('NO');
end.