#include <bits/stdc++.h>
using namespace std;
int dp[52][52][52][52];
string s[52];
int n;
bool can(int i1, int i2) {
  return (s[i1][0] == s[i2][0]) || (s[i1][1] == s[i2][1]);
}
int solve(int pt, int c1, int c2, int c3) {
  if (dp[pt][c1][c2][c3] != -1) return dp[pt][c1][c2][c3];
  if (pt == 0) {
    return dp[pt][c1][c2][c3] = 1;
  } else if (pt == 1) {
    return dp[pt][c1][c2][c3] = can(c2, c3);
  } else if (pt == 2) {
    return dp[pt][c1][c2][c3] = can(c3, c2) && can(c3, c1);
  } else {
    int ans = 0;
    if (can(c3, c2)) ans |= solve(pt - 1, pt - 3, c1, c3);
    if (can(c3, pt - 3)) ans |= solve(pt - 1, c3, c1, c2);
    return dp[pt][c1][c2][c3] = ans;
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  for (int i = 0; i < 52; i++) {
    for (int j = 0; j < 52; j++) {
      for (int k = 0; k < 52; k++) {
        for (int m = 0; m < 52; m++) {
          dp[i][j][k][m] = -1;
        }
      }
    }
  }
  cin >> n;
  for (int i = 0; i < n; i++) cin >> s[i];
  if (n == 1) {
    cout << "YES";
  } else if (n == 2) {
    int ans = can(0, 1);
    if (ans)
      cout << "YES";
    else
      cout << "NO";
  } else {
    int ans = solve(n - 1, n - 3, n - 2, n - 1);
    if (ans)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
