#include <bits/stdc++.h>
using namespace std;
int n;
char s[110][3];
int f[55][55][55][55];
bool dfs(int len, int a, int b, int c) {
  if (len == 1) return 1;
  if (f[len][a][b][c]) return 0;
  if (s[c][0] == s[b][0] || s[c][1] == s[b][1])
    if (dfs(len - 1, len - 3, a, c)) return 1;
  if (len > 3 && (s[c][0] == s[len - 3][0] || s[c][1] == s[len - 3][1]))
    if (dfs(len - 1, c, a, b)) return 1;
  f[len][a][b][c] = 1;
  return 0;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> s[i];
  if (dfs(n, n - 2, n - 1, n))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
