#include <bits/stdc++.h>
#pragma G++ optimize(2)
using namespace std;
const int M = 55;
char s[M][5];
int n, f[M][M][M][M];
bool dfs(int l, int a, int b, int c) {
  if (l == 1) return 1;
  if (f[l][a][b][c]) return 0;
  if (s[b][0] == s[a][0] || s[b][1] == s[a][1])
    if (dfs(l - 1, a, c, l - 3)) return 1;
  if (l > 3)
    if (s[l - 3][0] == s[a][0] || s[l - 3][1] == s[a][1])
      if (dfs(l - 1, b, c, a)) return 1;
  f[l][a][b][c] = 1;
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> s[i];
  if (dfs(n, n, n - 1, n - 2))
    puts("YES");
  else
    puts("NO");
  return 0;
}
