#include <bits/stdc++.h>
using namespace std;
const int N = 52;
int n, f;
string s[N];
map<string, bool> vis;
void dfs(int k) {
  if (!k) {
    f = 1;
    return;
  }
  if (k && (s[k][0] == s[k - 1][0] || s[k][1] == s[k - 1][1])) {
    string tp = s[k - 1], p;
    s[k - 1] = s[k];
    for (register int i = 0; i < k; ++i) p += s[i];
    if (!vis[p]) vis[p] = 1, dfs(k - 1);
    if (f) return;
    s[k - 1] = tp;
  }
  if (k >= 3 && (s[k][0] == s[k - 3][0] || s[k][1] == s[k - 3][1])) {
    string tp = s[k - 3], p;
    s[k - 3] = s[k];
    for (register int i = 0; i < k; ++i) p += s[i];
    if (!vis[p]) vis[p] = 1, dfs(k - 1);
    if (f) return;
    s[k - 3] = tp;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (register int i = 0; i < n; ++i) cin >> s[i];
  dfs(n - 1);
  if (f)
    puts("YES");
  else
    puts("NO");
}
