#include <bits/stdc++.h>
using namespace std;
int n;
string li[55];
struct lala {
  string d, e, f;
  int bn;
  bool operator<(const lala &asdf) const {
    if (bn == asdf.bn) {
      if (d == asdf.d) {
        if (e == asdf.e) {
          if (f[0] == asdf.f[0])
            return f[1] < asdf.f[1];
          else
            return f[0] < asdf.f[0];
        }
        if (e[0] == asdf.e[0])
          return e[1] < asdf.e[1];
        else
          return e[0] < asdf.e[0];
      }
      if (d[0] == asdf.d[0])
        return d[1] < asdf.d[1];
      else
        return d[0] < asdf.d[0];
    }
    return bn < asdf.bn;
  }
};
map<lala, bool> memo;
map<lala, bool> vis;
bool dp(string s1, string s2, string s3, int id) {
  if (id == 1) return 1;
  bool ret = 0;
  lala bme;
  bme.d = s1;
  bme.e = s2;
  bme.f = s3;
  bme.bn = id;
  if (vis[bme] == 1) return memo[bme];
  vis[bme] = 1;
  if (s2[0] == s3[0] || s2[1] == s3[1]) {
    string haha;
    if ((id - 3) < 1)
      haha = "00";
    else
      haha = li[id - 3];
    ret = ret | dp(haha, s1, s3, id - 1);
  }
  if (ret) return memo[bme] = ret;
  if ((id - 3) < 1) return memo[bme] = ret;
  if (li[id - 3][0] == s3[0] || li[id - 3][1] == s3[1]) {
    ret = ret | dp(s3, s1, s2, id - 1);
  }
  return memo[bme] = ret;
}
int main() {
  memo.clear();
  vis.clear();
  scanf("%d", &n);
  getchar();
  for (int i = 1; i <= n; i++) {
    cin >> li[i];
  }
  string a, b, c;
  c = li[n];
  if (n - 1 > 0)
    b = li[n - 1];
  else
    b = "00";
  if (n - 2 > 0)
    a = li[n - 2];
  else
    a = "00";
  bool ans = dp(a, b, c, n);
  if (ans)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
