#include <bits/stdc++.h>
using namespace std;
const int N = 54 + 10, Mod = 998244353;
int n;
string t[N];
bool dp[N][N][N][N] = {}, vis[N][N][N][N] = {};
char x[] = {' ', '2', '3', '4', '5', '6', '7',
            '8', '9', 'T', 'J', 'Q', 'K', 'A'},
     y[] = {' ', 'S', 'D', 'H', 'C'};
void id(string s, int &j, int &i, int &val) {
  j = i = 1;
  for (; j <= 13; j++)
    if (s[0] == x[j]) break;
  for (; i <= 4; i++)
    if (s[1] == y[i]) break;
  val = i * j;
}
bool comput(int cnt, string a, string b, string c) {
  int aval, bval, cval;
  int a1, a2, b1, b2, c1, c2;
  id(a, a1, a2, aval);
  id(b, b1, b2, bval);
  id(c, c1, c2, cval);
  if (vis[cnt][aval][bval][cval]) return dp[cnt][aval][bval][cval];
  vis[cnt][aval][bval][cval] = 1;
  bool res = 0;
  if (cnt == 0) {
    bool fl1 = (c1 == b1 || c2 == b2), fl2 = (c1 == a1 || c2 == a2);
    if (fl1 && fl2) dp[0][aval][bval][cval] = res = 1;
    return res;
  }
  int pval, p1, p2;
  id(t[cnt], p1, p2, pval);
  bool mv1 = (c1 == b1 || c2 == b2), mv3 = (c1 == p1 || c2 == p2);
  if (mv1 && comput(cnt - 1, t[cnt], a, c)) dp[cnt][aval][bval][cval] = res = 1;
  if (mv3 && comput(cnt - 1, c, a, b)) dp[cnt][aval][bval][cval] = res = 1;
  return res;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> t[i];
  if (n == 1) return cout << "YES", 0;
  if (n == 2) {
    int aval, bval, a1, a2, b1, b2;
    id(t[1], a1, a2, aval);
    id(t[2], b1, b2, bval);
    if (a1 == a2 || b1 == b2)
      return cout << "YES", 0;
    else
      return cout << "NO", 0;
  }
  if (comput(n - 3, t[n - 2], t[n - 1], t[n]))
    cout << "YES";
  else
    cout << "NO";
}
