#include <bits/stdc++.h>
using namespace std;
int id[150];
int n;
int a[60], b[60];
bool dp[55][55][55][55];
bool check(int x, int y) { return (a[x] == a[y]) || (b[x] == b[y]); }
bool dfs(int i, int c1, int c2, int c3) {
  if (i == 0) return true;
  if (i >= 2) {
    if (dp[i][c1][c2][c3]) return false;
    dp[i][c1][c2][c3] = 1;
  }
  if (check(c1, c2) && dfs(i - 1, c1, c3, i - 3)) return true;
  if (i - 3 >= 0 && check(c1, i - 3) && dfs(i - 1, c2, c3, c1)) return true;
  return false;
}
int main() {
  id['S'] = 0;
  id['D'] = 1;
  id['H'] = 2;
  id['C'] = 3;
  id['2'] = 0;
  id['3'] = 1;
  id['4'] = 2;
  id['5'] = 3;
  id['6'] = 4;
  id['7'] = 5;
  id['8'] = 6;
  id['9'] = 7;
  id['T'] = 8;
  id['J'] = 9;
  id['Q'] = 10;
  id['K'] = 11;
  id['A'] = 12;
  scanf("%d", &n);
  char str[10];
  for (int i = 0; i < n; i++) {
    scanf("%s", str);
    a[i] = id[str[0]];
    b[i] = id[str[1]];
  }
  if (dfs(n - 1, n - 1, n - 2, n - 3))
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
