#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int n, m, k, maxx, cur, x, y;
int minn;
int nex[4][2] = {0, 1, 1, 0, 0, -1, -1, 0};
bool dp[55][55][55][55];
char s[50][10];
int dfs(int len, int s1, int s2, int s3) {
  if (len == 1) return 1;
  if (dp[len][s1][s2][s3]) return 0;
  if (s[s3][0] == s[s2][0] || s[s3][1] == s[s2][1]) {
    if (dfs(len - 1, len - 3, s1, s3)) return 1;
  }
  if (len >= 4 && s[s3][0] == s[len - 3][0] || s[s3][1] == s[len - 3][1]) {
    if (dfs(len - 1, s3, s1, s2)) return 1;
  }
  dp[len][s1][s2][s3] = 1;
  return 0;
}
int main() {
  while (cin >> n) {
    memset(dp, 0, sizeof(dp));
    ;
    for (int i = 1; i < n + 1; i++) scanf("%s", s[i]);
    if (dfs(n, n - 2, n - 1, n))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
