#include <bits/stdc++.h>
using namespace std;
const int MAX = 55, oo = 1 << 28;
map<pair<int, string>, bool> dp;
string card[MAX];
bool solve(pair<int, string> &s) {
  if (s.first == 1) return true;
  if (dp.count(s)) return dp[s];
  bool ok = s.second[2] == s.second[4] || s.second[3] == s.second[5];
  bool &ret = dp[s];
  ret = false;
  pair<int, string> n;
  string tmp = s.first > 3 ? card[s.first - 3] : string("$$");
  if (s.first > 3) {
    if (s.second[4] == tmp[0] || s.second[5] == tmp[1]) {
      n = pair<int, string>(s.first - 1,
                            s.second.substr(4, 2) + s.second.substr(0, 4));
      ret |= solve(n);
    }
  }
  n = pair<int, string>(s.first - 1,
                        tmp + s.second.substr(0, 2) + s.second.substr(4, 2));
  if (ok) ret |= solve(n);
  return ret;
}
int main() {
  int N;
  cin >> N;
  for (int i = 1; i <= N; ++i) cin >> card[i];
  string tmp = card[N];
  if (N > 1) tmp = card[N - 1] + tmp;
  if (N > 2) tmp = card[N - 2] + tmp;
  while (tmp.length() < 6) tmp = string("$$") + tmp;
  pair<int, string> s = pair<int, string>(N, tmp);
  puts(solve(s) ? "YES" : "NO");
  return 0;
}
