#include <bits/stdc++.h>
using namespace std;
pair<char, char> cards[60];
int dp[52][52][52][52];
bool dfs(int i, int a, int b, int c) {
  if (i == 0) return true;
  if (dp[i][a][b][c] != -1) return dp[i][a][b][c];
  if (i > 2 && (cards[i - 3].first == cards[c].first ||
                cards[i - 3].second == cards[c].second))
    if (dfs(i - 1, c, a, b)) return dp[i][a][b][c] = true;
  if (cards[b].first == cards[c].first || cards[b].second == cards[c].second)
    if (dfs(i - 1, i - 3, a, c)) return dp[i][a][b][c] = true;
  return dp[i][a][b][c] = false;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < 52; i++)
    for (int j = 0; j < 52; j++)
      for (int s = 0; s < 52; s++)
        for (int t = 0; t < 52; t++) dp[i][j][s][t] = -1;
  for (int i = 0; i < n; i++) {
    cin >> cards[i].first;
    cin >> cards[i].second;
  }
  if (dfs(n - 1, n - 3, n - 2, n - 1))
    cout << "YES";
  else
    cout << "NO";
}
