#include <bits/stdc++.h>
using namespace std;
int dx[] = {-1, 0, 1, 0, -1, -1, 1, 1};
int dy[] = {0, 1, 0, -1, -1, 1, -1, 1};
const int maxn = 105;
int n;
char na[100][2];
int f[53][53][53][53];
bool OK(int x, int y) {
  if (na[x][1] == na[y][1] || na[x][0] == na[y][0]) return true;
  return false;
}
bool DFS(int k, int a, int b, int c) {
  if (f[k][a][b][c] != -1) return f[k][a][b][c];
  if (k == 2) {
    if (OK(b, c)) return (f[k][a][b][c] = 1);
    return (f[k][a][b][c] = 0);
  }
  if (k > 3 && OK(k - 3, c) && DFS(k - 1, c, a, b)) return (f[k][a][b][c] = 1);
  if (OK(c, b) && DFS(k - 1, k - 3, a, c)) return (f[k][a][b][c] = 1);
  return (f[k][a][b][c] = 0);
}
int main() {
  memset(f, -1, sizeof(f));
  scanf("%d", &(n));
  for (int(i) = (1); (i) <= (n); (i)++) {
    scanf("%s", na[i]);
  }
  if (n == 1) {
    puts("YES");
    return 0;
  }
  if (DFS(n, n - 2, n - 1, n))
    puts("YES");
  else
    puts("NO");
}
