#include <bits/stdc++.h>
char c[60][4];
int temp[56][56][56][56], aaa[60];
int tr(char a[4]) {
  int sum = 0;
  if (a[1] == 'H') sum += 13;
  if (a[1] == 'D') sum += 26;
  if (a[1] == 'C') sum += 39;
  if (a[0] >= '2' && a[0] <= '9') sum += (a[0] - 50);
  if (a[0] == 'A') sum += 12;
  if (a[0] == 'K') sum += 11;
  if (a[0] == 'Q') sum += 10;
  if (a[0] == 'J') sum += 9;
  if (a[0] == 'T') sum += 8;
  return sum;
}
int check(int a, int b) {
  if ((a % 13) == (b % 13) || (a / 13) == (b / 13)) {
    return 1;
  } else
    return 0;
}
int main() {
  int n, k, i, j, g;
  scanf("%d", &n);
  for (k = 1; k <= n; k++) {
    scanf("%s", &c[k]);
  }
  for (k = 1; k <= n; k++) {
    aaa[k] = tr(c[k]);
  }
  if (n == 1) {
    printf("YES");
    return 0;
  }
  if (n == 2) {
    if (check(aaa[1], aaa[2]))
      printf("YES");
    else
      printf("NO");
    getchar();
    getchar();
    return 0;
  }
  temp[aaa[n - 2]][aaa[n - 1]][aaa[n]][n] = 1;
  for (g = n; g >= 4; g--) {
    for (i = 0; i <= 51; i++) {
      for (j = 0; j <= 51; j++) {
        for (k = 0; k <= 51; k++) {
          if (temp[i][j][k][g] == 1) {
            if (check(j, k)) temp[aaa[g - 3]][i][k][g - 1] = 1;
            if (check(k, aaa[g - 3])) temp[k][i][j][g - 1] = 1;
          }
        }
      }
    }
  }
  for (i = 0; i <= 51; i++) {
    for (j = 0; j <= 51; j++) {
      for (k = 0; k <= 51; k++) {
        if (temp[i][j][k][3] == 1) {
          if (check(j, k) && check(i, k)) {
            printf("YES");
            goto GGG;
          }
        }
      }
    }
  }
  printf("NO");
GGG:;
  getchar();
  getchar();
}
