//Aideen's Code for P42 {aideen[at]gmail[dot]com}
#include <iostream>
using namespace std;

const int MAX_N = 15;

int n;
string w[MAX_N], s;
bool used[MAX_N];

bool bt(int x, int now) {
  if (x == n)
    return true;
  for (int i=0; i<n; i++)
    if (!used[i]) {
      for (unsigned j=0; j<w[i].length(); j++)
	if (w[i][j] != s[now+j])
	  goto nextword;
      used[i] = true;
      if (bt(x+1, now+w[i].length()))
	return true;
      used[i] = false;
    nextword: ;
    }
  return false;
}

int main() {
  cin >> n;
  for (int i=0; i<n; i++)
    cin >> w[i];
  cin >> s;

  bool ans = (bt(0, 0));
  cout << (ans?"YES":"NO") << endl;
    
  return 0;
}

