#include <bits/stdc++.h>
using namespace std;
using pcc = pair<char, char>;
void end(bool flag) { puts(flag ? "YES" : "NO"), exit(0); }
bool same(pcc a, pcc b) { return a.first == b.first || a.second == b.second; }
struct data {
  int n;
  pcc a, b, c;
  bool operator<(const data &p) const {
    if (n != p.n) return n < p.n;
    if (a != p.a) return a < p.a;
    if (b != p.b) return b < p.b;
    return c < p.c;
  }
} u, v;
pcc p[55];
queue<data> q;
set<data> s;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf(" %c %c", &p[i].first, &p[i].second);
  }
  if (n == 1) end(true);
  if (n == 2) end(same(p[2], p[1]));
  q.push({n - 3, p[n - 2], p[n - 1], p[n]});
  while (!q.empty()) {
    u = q.front();
    q.pop();
    if (!u.n && same(u.c, u.b) && same(u.c, u.a)) end(true);
    if (u.n) {
      if (same(u.c, u.b)) {
        v = {u.n - 1, p[u.n], u.a, u.c};
        if (s.find(v) == s.end()) {
          s.insert(v), q.push(v);
        }
      }
      if (same(u.c, p[u.n])) {
        v = {u.n - 1, u.c, u.a, u.b};
        if (s.find(v) == s.end()) {
          s.insert(v), q.push(v);
        }
      }
    }
  }
  end(false);
}
