#include <bits/stdc++.h>
using namespace std;
struct Card {
  int value;
  char suit;
} cards[60];
bool dp[60][60][60][60];
int gaps[2] = {1, 3};
bool check(int x, int y) {
  if (cards[x].value == cards[y].value) return true;
  if (cards[x].suit == cards[y].suit) return true;
  return false;
}
int get_value(char ch) {
  if (ch <= '9') return ch -= '0';
  if (ch == 'T') return 10;
  if (ch == 'J') return 11;
  if (ch == 'Q') return 12;
  if (ch == 'K') return 13;
  if (ch == 'A') return 1;
}
int get_suit(char ch) {
  if (ch == 'S') return 1;
  if (ch == 'C') return 2;
  if (ch == 'D') return 3;
  if (ch == 'H') return 4;
}
bool dfs(int now, int a, int b, int c) {
  if (dp[now][a][b][c]) return false;
  if (now == 1) return true;
  if (check(a, b))
    if (dfs(now - 1, a, c, now - 3)) return true;
  ;
  if (now - 3 > 0 && check(a, now - 3))
    if (dfs(now - 1, b, c, a)) return true;
  dp[now][a][b][c] = true;
  return false;
}
int main() {
  int n;
  scanf("%d", &n);
  memset(dp, false, sizeof(dp));
  for (int i = 1; i <= n; i++) {
    char card_info[5];
    scanf("%s", card_info);
    cards[i].value = get_value(card_info[0]);
    cards[i].suit = card_info[1];
  }
  printf(dfs(n, n, n - 1, n - 2) ? "YES\n" : "NO\n");
  return 0;
}
