#include <bits/stdc++.h>
using namespace std;
const int N = 55;
int n, f[N][N][N][N];
char s[N][5];
int dfs(int pos, int x, int y, int z) {
  if (pos == 1) return 1;
  if (f[pos][x][y][z] != -1) return f[pos][x][y][z];
  int &k = f[pos][x][y][z];
  if (s[y][1] == s[z][1] || s[y][2] == s[z][2]) {
    if (dfs(pos - 1, pos - 3, x, z)) {
      return k = 1;
    }
  }
  if (pos > 3) {
    if (s[pos - 3][1] == s[z][1] || s[pos - 3][2] == s[z][2]) {
      if (dfs(pos - 1, z, x, y)) {
        return k = 1;
      }
    }
  }
  return k = 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  memset(f, -1, sizeof(f));
  puts(dfs(n, n - 2, n - 1, n) ? "YES" : "NO");
  return 0;
}
