#include <bits/stdc++.h>
using namespace std;
bool flag;
string a[55];
map<string, int> vis;
void dfs(int x) {
  if (x == 1) {
    flag = 1;
    return;
  }
  if (x >= 2 && (a[x][0] == a[x - 1][0] || a[x][1] == a[x - 1][1])) {
    string t = a[x - 1];
    a[x - 1] = a[x];
    string jud;
    for (int i = 1; i <= x - 1; i++) jud += a[i];
    if (!vis[jud]) {
      vis[jud] = 1;
      dfs(x - 1);
    }
    a[x - 1] = t;
    if (flag) return;
  }
  if (x >= 4 && (a[x][0] == a[x - 3][0] || a[x][1] == a[x - 3][1])) {
    string t = a[x - 3];
    a[x - 3] = a[x];
    string jud;
    for (int i = 1; i <= x - 1; i++) jud += a[i];
    if (!vis[jud]) {
      vis[jud] = 1;
      dfs(x - 1);
    }
    a[x - 3] = t;
    if (flag) return;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> a[i];
  dfs(n);
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
