#include <bits/stdc++.h>
using namespace std;
int a[100], b[100], dp[60][60][60][60];
bool check(int i, int j) {
  if (a[i] == a[j] || b[i] == b[j]) return true;
  return false;
}
int dfs(int i, int j, int k, int r) {
  if (dp[i][j][k][r]) return 0;
  if (i == 3)
    if (check(j, r) && check(k, r)) return 1;
  if (check(k, r) && dfs(i - 1, i - 3, j, r)) return 1;
  if (check(i - 3, r) && dfs(i - 1, r, j, k)) return 1;
  dp[i][j][k][r] = 1;
  return 0;
}
int main() {
  memset(dp, 0, sizeof dp);
  int n, i;
  cin >> n;
  for (i = 1; i <= n; i++) {
    char t1, t2;
    cin >> t1 >> t2;
    a[i] = t1;
    b[i] = t2;
  }
  if (dfs(n, n - 2, n - 1, n) || n == 1)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
