#include <bits/stdc++.h>
using namespace std;
string s[60];
int dp[60][60][60][60];
inline bool can(int i, int j) {
  return ((s[i][0] == s[j][0]) || (s[i][1] == s[j][1]));
}
int rec(int len, int x, int y, int z) {
  if (len == 3) return 1;
  if (dp[len][x][y][z] != -1) return dp[len][x][y][z];
  int ret = 0;
  if (can(y, z)) ret |= rec(len - 1, len - 3, x, z);
  if (len - 3 >= 3 && can(len - 3, z)) ret |= rec(len - 1, z, x, y);
  return dp[len][x][y][z] = ret;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  memset(dp, -1, sizeof dp);
  int n;
  cin >> n;
  for (int i = 3; i <= n + 2; i++) cin >> s[i];
  if (rec(n + 2, n, n + 1, n + 2))
    cout << "YES\n";
  else
    cout << "NO\n";
}
