#include <bits/stdc++.h>
char uf[101][4];
int s[101][2];
int dp[53][53][53][53];
int f(int a, int b) { return a * 4 + b; }
bool check() {
  if ((s[2][0] == s[1][0] || s[2][1] == s[1][1]) &&
      (s[2][0] == s[0][0] || s[2][1] == s[0][1])) {
    return 1;
  }
  return 0;
}
bool checkabc(int a, int b, int c) {
  if ((c / 4 == b / 4 || c % 4 == b % 4) &&
      (c / 4 == a / 4 || c % 4 == a % 4)) {
    return 1;
  }
  return 0;
}
int main() {
  int i, j, k, u;
  int n, m;
  while (scanf("%d", &n) == 1) {
    for (i = 0; i < n; i++) {
      scanf("%s", uf[i]);
      s[i][0] = uf[i][0] == 'T'   ? 10
                : uf[i][0] == 'J' ? 11
                : uf[i][0] == 'Q' ? 12
                : uf[i][0] == 'K' ? 13
                : uf[i][0] == 'A' ? 1
                                  : (uf[i][0] - '0');
      s[i][0]--;
      s[i][1] = uf[i][1] == 'S'   ? 0
                : uf[i][1] == 'D' ? 1
                : uf[i][1] == 'H' ? 2
                : uf[i][1] == 'C' ? 3
                                  : -1;
    }
    if (n == 1) {
      puts("YES");
      continue;
    } else if (n == 2) {
      if (s[0][0] == s[1][0] || s[0][1] == s[1][1]) {
        puts("YES");
      } else {
        puts("NO");
      }
      continue;
    } else if (n == 3) {
      if (check()) {
        puts("YES");
      } else {
        puts("NO");
      }
      continue;
    }
    memset(dp, 0, sizeof(dp));
    dp[n][f(s[n - 3][0], s[n - 3][1])][f(s[n - 2][0], s[n - 2][1])]
      [f(s[n - 1][0], s[n - 1][1])] = 1;
    for (i = n; i > 3; i--) {
      for (j = 0; j < 52; j++) {
        for (k = 0; k < 52; k++) {
          for (u = 0; u < 52; u++) {
            if (dp[i][j][k][u]) {
              if (s[i - 4][0] == u / 4 || s[i - 4][1] == u % 4) {
                dp[i - 1][u][j][k] = 1;
              }
              if (k / 4 == u / 4 || k % 4 == u % 4) {
                dp[i - 1][f(s[i - 4][0], s[i - 4][1])][j][u] = 1;
              }
            }
          }
        }
      }
    }
    for (j = 0; j < 52; j++) {
      for (k = 0; k < 52; k++) {
        for (u = 0; u < 52; u++) {
          if (dp[3][j][k][u] && checkabc(j, k, u)) {
            goto X;
          }
        }
      }
    }
    puts("NO");
    if (0) {
    X:
      puts("YES");
    }
  }
}
