#include <bits/stdc++.h>
using namespace std;
bool cmp(string a, string b) { return ((a[0] == b[0]) || (a[1] == b[1])); }
vector<string> a;
map<vector<string>, bool> dp;
bool rec(int id) {
  if (id == 1) {
    return true;
  }
  if (dp.count(a) != 0) {
    return dp[a];
  }
  bool res = 0;
  if (id > 3) {
    if (cmp(a[id], a[id - 3])) {
      string past = a[id - 3];
      a[id - 3] = a[id];
      a.pop_back();
      res |= rec(id - 1);
      a.push_back(a[id - 3]);
      a[id - 3] = past;
    }
  }
  if (!res) {
    if (cmp(a[id], a[id - 1])) {
      string past = a[id - 1];
      a[id - 1] = a[id];
      a.pop_back();
      res |= rec(id - 1);
      a.push_back(a[id - 1]);
      a[id - 1] = past;
    }
  }
  return (dp[a] = res);
}
int main() {
  int n;
  scanf("%d", &n);
  a.resize(n + 1);
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  printf("%s", (rec(n) ? "YES" : "NO"));
  return 0;
}
