#include <bits/stdc++.h>
using namespace std;
int dp[53][53][53][53];
char s[100][4];
int dfs(int x, int a, int b, int c) {
  if (x >= 2 && dp[x][a][b][c] != -1) return dp[x][a][b][c];
  if (x == 0) return 1;
  if (s[a][0] == s[b][0] || s[a][1] == s[b][1]) {
    if (dfs(x - 1, a, c, x - 3)) return x >= 2 ? (dp[x][a][b][c] = 1) : 1;
  }
  if (x - 3 >= 0 && (s[a][0] == s[x - 3][0] || s[a][1] == s[x - 3][1])) {
    if (dfs(x - 1, b, c, a)) return dp[x][a][b][c] = 1;
  }
  return x >= 2 ? (dp[x][a][b][c] = 0) : 0;
  ;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  memset(dp, -1, sizeof(dp));
  if (dfs(n - 1, n - 1, n - 2, n - 3))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
