#include <bits/stdc++.h>
using namespace std;
string str;
vector<string> v1;
map<vector<string>, int> vis;
void dfs(vector<string> a) {
  if (vis[a]) return;
  vis[a] = 1;
  if (a.size() == 1) {
    cout << "YES" << endl;
    exit(0);
  }
  int sz = a.size() - 1;
  vector<string> b;
  if (sz >= 1 && (a[sz][0] == a[sz - 1][0] || a[sz][1] == a[sz - 1][1])) {
    b = a;
    b[sz - 1] = a[sz];
    b.pop_back();
    dfs(b);
  }
  if (sz >= 3 && (a[sz][0] == a[sz - 3][0] || a[sz][1] == a[sz - 3][1])) {
    b = a;
    b[sz - 3] = a[sz];
    b.pop_back();
    dfs(b);
  }
}
int main() {
  int i, j, k, l, m, n;
  cin >> n;
  for (i = 0; i < n; i++) cin >> str, v1.push_back(str);
  dfs(v1);
  cout << "NO" << endl;
}
