#include <bits/stdc++.h>
using namespace std;
bool myfunction(int i, int j) { return (i < j); }
istream &in = cin;
int n;
int s[61];
bool dp[53][53][53][53];
bool chk[53][53][53][53];
bool match(int a, int b) {
  if (a / 13 == b / 13 || a % 13 == b % 13)
    return true;
  else
    return false;
}
int get(char a) {
  switch (a) {
    case 'A':
      return 0;
    case 'T':
      return 9;
    case 'J':
      return 10;
    case 'Q':
      return 11;
    case 'K':
      return 12;
    case 'S':
      return 0;
    case 'C':
      return 1;
    case 'D':
      return 2;
    case 'H':
      return 3;
    default:
      return a - '1';
  }
}
bool go(int sz, int c, int p1, int p2) {
  bool &ret = dp[sz][c][p1][p2];
  if (chk[sz][c][p1][p2]) return ret;
  chk[sz][c][p1][p2] = true;
  if (sz == 3) {
    if (match(c, p1) && match(c, p2))
      return 1;
    else
      return 0;
  }
  if (match(c, p1)) ret |= go(sz - 1, c, p2, s[sz - 3]);
  if (match(c, s[sz - 3])) ret |= go(sz - 1, p1, p2, c);
  return ret;
}
int main() {
  memset(s, 0, sizeof(s));
  memset(dp, 0, sizeof(dp));
  memset(chk, 0, sizeof(chk));
  in >> n;
  for (int i = 1; i <= n; ++i) {
    string tmp;
    in >> tmp;
    s[i] = get(tmp[0]) + get(tmp[1]) * 13;
  }
  if (n == 1)
    cout << "YES" << endl;
  else if (n <= 2) {
    if (match(s[1], s[2]))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else {
    if (go(n, s[n], s[n - 1], s[n - 2]))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
