#include <bits/stdc++.h>
using namespace std;
void Duxar(int _this_line) {}
template <class T>
void read_int(T &_value) {
  T sign = 1;
  char ch;
  _value = 0;
  while (!isdigit(ch = getchar())) {
    (ch == '-') && (sign = -1);
  }
  do {
    _value = _value * 10 + (ch - '0');
  } while (isdigit(ch = getchar()));
  _value *= sign;
}
template <class T>
T add_nr(T a, T b) {
  T _res = a + b;
  return _res % 1000000007;
}
bool YES;
unordered_set<string> visited;
string S;
int N;
void Solve(string deck);
int main() {
  int i;
  string aux;
  cin >> N;
  for (i = 0; i < N; ++i) {
    cin >> aux;
    S = S + aux;
  }
  Solve(S);
  if (YES) {
    printf("YES\n");
    return 0;
  }
  printf("NO\n");
  return 0;
}
void Solve(string deck) {
  if (visited.find(deck) != visited.end()) {
    return;
  }
  visited.insert(deck);
  int lg = deck.length();
  if (lg == 2) {
    YES = true;
    return;
  }
  if (YES) {
    return;
  }
  if (lg >= 4) {
    if (deck[lg - 1] == deck[lg - 3] || deck[lg - 2] == deck[lg - 4]) {
      swap(deck[lg - 1], deck[lg - 3]);
      swap(deck[lg - 2], deck[lg - 4]);
      Solve(deck.substr(0, lg - 2));
      swap(deck[lg - 1], deck[lg - 3]);
      swap(deck[lg - 2], deck[lg - 4]);
    }
  }
  if (lg >= 8) {
    if (deck[lg - 1] == deck[lg - 7] || deck[lg - 2] == deck[lg - 8]) {
      swap(deck[lg - 1], deck[lg - 7]);
      swap(deck[lg - 2], deck[lg - 8]);
      Solve(deck.substr(0, lg - 2));
      swap(deck[lg - 1], deck[lg - 7]);
      swap(deck[lg - 2], deck[lg - 8]);
    }
  }
}
