#include <bits/stdc++.h>
using namespace std;
bool op(string f, string s) {
  if (f[0] == s[0] || f[1] == s[1])
    return true;
  else
    return false;
}
vector<vector<vector<string> > > vis(100);
vector<vector<string> >::iterator iter;
bool prov(vector<string> f, int k) {
  for (iter = vis[k].begin(); iter < vis[k].end(); iter++) {
    if (f == *iter) return true;
  }
  return false;
}
int main() {
  vector<string> vect;
  for (int i = 1; i < 54; i++) vis[i].clear();
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string temp = "";
    char my;
    for (int j = 0; j < 2; j++) {
      cin >> my;
      temp += my;
    }
    vect.push_back(temp);
  }
  queue<vector<string> > q;
  q.push(vect);
  while (!q.empty()) {
    vector<string> temp = q.front();
    q.pop();
    if (temp.size() <= 1) {
      cout << "YES";
      return 0;
    }
    int h = temp.size() - 1;
    if (op(temp[h], temp[h - 1])) {
      vector<string> temp1 = temp;
      temp1[h - 1] = temp[h];
      temp1.resize(temp.size() - 1);
      if (!prov(temp1, temp1.size())) {
        vis[temp.size() - 1].push_back(temp1);
        q.push(temp1);
      }
    }
    if ((h - 3 >= 0) && op(temp[h], temp[h - 3])) {
      vector<string> temp1 = temp;
      temp1[h - 3] = temp[h];
      temp1.resize(temp.size() - 1);
      if (!prov(temp1, temp1.size())) {
        vis[temp.size() - 1].push_back(temp1);
        q.push(temp1);
      }
    }
  }
  cout << "NO";
  return 0;
}
