#include <bits/stdc++.h>
using namespace std;
string C[55];
int N, dp[55][55][55][55];
void read() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> C[i];
}
bool control(int a, int b) {
  return ((C[a][0] == C[b][0]) || (C[a][1] == C[b][1]));
}
int f(int n, int x, int y, int z) {
  int &res = dp[n][x][y][z];
  if (res) return res;
  if (n == 1) return res = (control(z, y) && control(z, x)) ? 1 : -1;
  if (control(z, y) && f(n - 1, n - 1, x, z) == 1) return res = 1;
  if (control(z, n - 1) && f(n - 1, z, x, y) == 1) return res = 1;
  return res = -1;
}
void solve() {
  if (N == 1) {
    cout << "YES" << endl;
    return;
  }
  if (N == 2) {
    if (control(2, 1))
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
    return;
  }
  if (f(N - 2, N - 2, N - 1, N) == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
int main() {
  read();
  solve();
}
