#include <bits/stdc++.h>
using namespace std;
map<vector<string>, bool> m;
int k = 0;
void recurse(vector<string> s) {
  if (s.size() == 1) {
    k = 1;
  }
  if (k) return;
  if (m[s]) return;
  m[s] = 1;
  int len = s.size();
  if (len >= 2 &&
      (s[len - 1][0] == s[len - 2][0] || s[len - 1][1] == s[len - 2][1])) {
    vector<string> temp = s;
    temp[len - 2] = temp[len - 1];
    temp.erase(temp.begin() + temp.size() - 1);
    recurse(temp);
  }
  if (len >= 4 &&
      (s[len - 1][0] == s[len - 4][0] || s[len - 1][1] == s[len - 4][1])) {
    vector<string> temp = s;
    temp[len - 4] = temp[len - 1];
    temp.erase(temp.begin() + temp.size() - 1);
    recurse(temp);
  }
}
int main() {
  int n;
  cin >> n;
  vector<string> s;
  for (int i = 0; i < n; i++) {
    string x;
    cin >> x;
    s.push_back(x);
  }
  recurse(s);
  if (k)
    cout << "YES";
  else
    cout << "NO";
}
