#include <bits/stdc++.h>
using namespace std;
long long a[50];
long long b[5];
long long c[5];
map<vector<string>, char> m;
char puede(vector<string>& v, int p) {
  int n = v.size();
  if (n <= p) return 0;
  return v[n - p - 1][0] == v[n - 1][0] || v[n - p - 1][1] == v[n - 1][1];
}
vector<string> mod(vector<string> v, int p) {
  int n = v.size();
  v[n - p - 1] = v[n - 1];
  v.pop_back();
  return v;
}
char f(vector<string> v) {
  int n = v.size();
  if (n == 1) return 1;
  if (m.find(v) != m.end()) return m[v];
  if (puede(v, 1)) {
    if (f(mod(v, 1))) return m[v] = 1;
  }
  if (puede(v, 3)) {
    if (f(mod(v, 3))) return m[v] = 1;
  }
  return m[v] = 0;
}
int main() {
  int n;
  cin >> n;
  vector<string> v(n);
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  puts(f(v) ? "YES" : "NO");
}
