#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &a) {
  T ret(0), f(1);
  char ch(getchar());
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    ret = (ret << 2) + ret, ret += ret + (ch ^ 48);
    ch = getchar();
  }
  a = ret * f;
}
inline int Max(int x, int y) { return x > y ? x : y; }
inline int Min(int x, int y) { return x < y ? x : y; }
char a[55][5];
int dp[55][55][55][55];
int dfs(int x, int s1, int s2, int s3) {
  if (x == 1) return 1;
  if (dp[x][s1][s2][s3] == 0) return 0;
  if (x >= 2 && (a[s3][0] == a[s2][0] || a[s3][1] == a[s2][1]))
    if (dfs(x - 1, x - 3, s1, s3)) return 1;
  if (x >= 4 && (a[x - 3][0] == a[s3][0] || a[x - 3][1] == a[s3][1]))
    if (dfs(x - 1, s3, s1, s2)) return 1;
  return dp[x][s1][s2][s3] = 0;
}
int main() {
  int n;
  read(n);
  memset(dp, -1, sizeof(dp));
  for (int i(1); i <= n; i++) scanf("%s", a[i]);
  printf("%s", dfs(n, n - 2, n - 1, n) ? "YES" : "NO");
  return 0;
}
