#include <bits/stdc++.h>
using namespace std;
int n;
bool dp[53][53][53][53];
char s[53][53];
bool dfs(int s0, int s1, int s2, int s3) {
  if (s0 == 1) return true;
  if (dp[s0][s1][s2][s3]) return false;
  if (s[s3][0] == s[s2][0] || s[s3][1] == s[s2][1]) {
    if (dfs(s0 - 1, s0 - 3, s1, s3)) return true;
  }
  if (s0 >= 4 && (s[s3][0] == s[s0 - 3][0] || s[s3][1] == s[s0 - 3][1])) {
    if (dfs(s0 - 1, s3, s1, s2)) return true;
  }
  dp[s0][s1][s2][s3] = true;
  return false;
}
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%s", s[i]);
    memset(dp, false, sizeof(dp));
    if (dfs(n, n - 2, n - 1, n))
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
