#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-5;
const int inf = 1000000000;
const int mod = 1000000007;
int dp[55][55][55][55];
char kind[55];
char cnt[55];
bool dfs(int i, int a, int b, int c) {
  if (dp[i][a][b][c] != -1) return dp[i][a][b][c];
  if (i == 1) return true;
  int ret = 0;
  if (cnt[c] == cnt[b] || kind[c] == kind[b]) ret |= dfs(i - 1, i - 3, a, c);
  if (i > 3 && (cnt[c] == cnt[i - 3] || kind[c] == kind[i - 3]))
    ret |= dfs(i - 1, c, a, b);
  dp[i][a][b][c] = ret;
  return ret;
}
int n;
int main() {
  scanf("%d", &n);
  char tmp[5];
  for (int i = 1; i <= n; i++) {
    scanf("%s", tmp);
    cnt[i] = tmp[0];
    kind[i] = tmp[1];
  }
  memset((dp), -1, sizeof(dp));
  if (dfs(n, n - 2, n - 1, n))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
