#include <bits/stdc++.h>
using namespace std;
vector<string> v;
map<vector<string>, int> m;
bool result;
int n;
void dfs(vector<string> v) {
  if (m[v]) return;
  m[v] = 1;
  int x = v.size();
  if (x == 1) result = true;
  if (x > 1 && (v[x - 1][0] == v[x - 2][0] || v[x - 1][1] == v[x - 2][1])) {
    vector<string> u = v;
    u[x - 2] = u[x - 1];
    u.erase(u.end() - 1);
    dfs(u);
  }
  if (x > 3 && (v[x - 1][0] == v[x - 4][0] || v[x - 1][1] == v[x - 4][1])) {
    vector<string> u = v;
    u[x - 4] = u[x - 1];
    u.erase(u.end() - 1);
    dfs(u);
  }
  return;
}
int main() {
  int i, j;
  string s;
  while (cin >> n) {
    for (v.clear(), m.clear(), i = 0; i < n; ++i) {
      cin >> s;
      v.push_back(s);
    }
    result = false;
    dfs(v);
    if (result)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
