#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:16777216")
using namespace std;
int A[53], N;
bool dp[53][53][53][53];
char value[] = {'2', '3', '4', '5', '6', '7', '8',
                '9', 'T', 'J', 'Q', 'K', 'A'};
char suit[] = {'S', 'D', 'H', 'C'};
int fv(char c) {
  for (int i = 0; i < 13; i++)
    if (value[i] == c) return i;
}
int fs(char c) {
  for (int i = 0; i < 4; i++)
    if (suit[i] == c) return i;
}
bool mtc(int k1, int k2) { return k1 / 4 == k2 / 4 || k1 % 4 == k2 % 4; }
int main() {
  cin >> N;
  char c1, c2;
  for (int i = 1; i <= N; i++) {
    cin >> c1 >> c2;
    A[i] = fv(c1) * 4 + fs(c2);
  }
  if (N >= 3) {
    for (int k1 = 0; k1 <= 51; k1++)
      for (int k2 = 0; k2 <= 51; k2++)
        for (int k3 = 0; k3 <= 51; k3++)
          if (mtc(k3, k2) && mtc(k3, k1)) dp[3][k1][k2][k3] = 1;
    for (int i = 4; i <= N; i++)
      for (int k1 = 0; k1 <= 51; k1++)
        for (int k2 = 0; k2 <= 51; k2++)
          for (int k3 = 0; k3 <= 51; k3++) {
            if (mtc(k3, k2)) dp[i][k1][k2][k3] |= dp[i - 1][A[i - 3]][k1][k3];
            if (mtc(k3, A[i - 3])) dp[i][k1][k2][k3] |= dp[i - 1][k3][k1][k2];
          }
    if (dp[N][A[N - 2]][A[N - 1]][A[N]])
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else if (N == 2) {
    if (mtc(A[2], A[1]))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  } else
    cout << "YES" << endl;
  return 0;
}
