#include <bits/stdc++.h>
char pile[60][5];
bool f[60][60][60][60];
bool vis[60][60][60][60];
int n;
bool canPut(int a, int b) {
  return pile[a][0] == pile[b][0] || pile[a][1] == pile[b][1];
}
bool dfs(int dep, int a, int b, int c) {
  if (vis[dep][a][b][c]) return f[dep][a][b][c];
  vis[dep][a][b][c] = true;
  if (dep <= 3) {
    f[dep][a][b][c] = canPut(c, b) && canPut(c, a);
    return f[dep][a][b][c];
  }
  if (canPut(c, b)) {
    f[dep - 1][dep - 4][a][c] = dfs(dep - 1, dep - 4, a, c);
    if (f[dep - 1][dep - 4][a][c]) return true;
  }
  if (canPut(c, dep - 4)) {
    f[dep - 1][c][a][b] = dfs(dep - 1, c, a, b);
    if (f[dep - 1][c][a][b]) return true;
  }
  return false;
}
int main() {
  int i;
  while (scanf("%d", &n) != EOF) {
    for (i = 0; i < n; ++i) {
      scanf("%s", pile[i]);
    }
    if (n == 1)
      printf("YES\n");
    else if (n == 2)
      printf("%s\n", canPut(1, 0) ? "YES" : "NO");
    else {
      memset(f, 0, sizeof(f));
      memset(vis, 0, sizeof(vis));
      printf("%s\n", dfs(n, n - 3, n - 2, n - 1) ? "YES" : "NO");
    }
  }
  return 0;
}
