#include <bits/stdc++.h>
char c[53][3];
int M[53][53];
bool vis[53][53][53][53];
int dfs(int m, int m1, int m2, int m3) {
  if (vis[m][m1][m2][m3]) return false;
  if (m == 3 && M[m1][m3] && M[m3][m2]) return true;
  if (M[m2][m3] && dfs(m - 1, m - 4, m1, m3)) return true;
  if (m >= 4 && M[m3][m - 4] && dfs(m - 1, m3, m1, m2)) return true;
  vis[m][m1][m2][m3] = 1;
  return false;
}
int main() {
  int n;
  while (~scanf("%d", &n)) {
    for (int i = 0; i < n; i++) {
      scanf("%s", c[i]);
    }
    if (n == 1) {
      printf("YES\n");
      continue;
    }
    memset(M, 0, sizeof(M));
    memset(vis, 0, sizeof(vis));
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        if (i != j)
          if (c[i][0] == c[j][0] || c[i][1] == c[j][1]) {
            M[i][j] = 1;
            M[j][i] = 1;
          }
      }
    }
    if (dfs(n, n - 3, n - 2, n - 1))
      puts("YES");
    else
      puts("NO");
  }
  return 0;
}
