#include <bits/stdc++.h>
const int N = 52 + 5;
int n;
std::string str[N];
int dp[N][N][N][N];
bool able(int i, int j) {
  return str[i][0] == str[j][0] || str[i][1] == str[j][1];
}
bool dfs(int n, int i, int j, int k) {
  int& ret = dp[n][i][j][k];
  if (ret != -1) {
    return ret;
  } else if (n == 3) {
    return ret = (able(j, k) && able(k, i));
  }
  ret = 0;
  if (able(j, k)) {
    if (dfs(n - 1, n - 4, i, k)) {
      return ret = 1;
    }
  }
  if (able(n - 4, k)) {
    if (dfs(n - 1, k, i, j)) {
      return ret = 1;
    }
  }
  return ret = 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    std::cin >> str[i];
  }
  if (n == 1) {
    puts("YES");
    return 0;
  } else if (n == 2) {
    puts(able(0, 1) ? "YES" : "NO");
    return 0;
  } else {
    memset(dp, -1, sizeof(dp));
    puts(dfs(n, n - 3, n - 2, n - 1) ? "YES" : "NO");
    return 0;
  }
  return 0;
}
