#include <bits/stdc++.h>
using namespace std;
int f[54][54][54][54];
char a[100], b[100];
int n;
bool check(int x, int y) { return (a[x] == a[y] || b[x] == b[y]); }
int dfs(int i, int j, int l, int r) {
  if (f[i][j][l][r]) return 0;
  if (i == 3) return check(j, r) && check(l, r);
  if (check(l, r))
    if (dfs(i - 1, i - 3, j, r)) return 1;
  if (check(i - 3, r))
    if (dfs(i - 1, r, j, l)) return 1;
  f[i][j][l][r] = 1;
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i] >> b[i];
  if (n == 1 || dfs(n, n - 2, n - 1, n))
    puts("YES");
  else
    puts("NO");
  return 0;
}
