#include <bits/stdc++.h>
using namespace std;
const int MAXN = 53;
bool d[MAXN][MAXN][MAXN][MAXN];
int n;
string s[MAXN];
struct State {
  int n, a, b, c;
  State(int n, int a, int b, int c) : n(n), a(a), b(b), c(c) {}
};
bool joinable(int id1, int id2) {
  return (s[id1][0] == s[id2][0] || s[id1][1] == s[id2][1]);
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> s[i];
  }
  queue<State> q;
  d[n][n][max(0, n - 1)][max(0, n - 2)] = true;
  q.push(State(n, n, max(0, n - 1), max(0, n - 2)));
  while (!q.empty()) {
    State v = q.front();
    q.pop();
    if (v.n > 3 && joinable(v.a, v.n - 3)) {
      if (!d[v.n - 1][v.b][v.c][v.a]) {
        d[v.n - 1][v.b][v.c][v.a] = true;
        q.push(State(v.n - 1, v.b, v.c, v.a));
      }
    }
    if (v.n > 1 && joinable(v.a, v.b)) {
      if (!d[v.n - 1][v.a][v.c][max(0, v.n - 3)]) {
        d[v.n - 1][v.a][v.c][max(0, v.n - 3)] = true;
        q.push(State(v.n - 1, v.a, v.c, max(0, v.n - 3)));
      }
    }
  }
  for (int a = 1; a <= n; ++a) {
    if (d[1][a][0][0]) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
  return 0;
}
