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