#include <bits/stdc++.h>
using namespace std;
vector<string> cards;
map<vector<string>, bool> mp;
inline bool match(string a, string b) { return a[0] == b[0] || a[1] == b[1]; }
bool solve(vector<string> &cards) {
  int l = cards.size() - 1;
  if (l == 0) return true;
  if (mp.find(cards) != mp.end()) {
    return mp[cards];
  }
  string v = cards[l - 1];
  bool a = false;
  if (match(cards[l], cards[l - 1])) {
    cards[l - 1] = cards[l];
    cards.pop_back();
    a = solve(cards);
    cards.push_back(cards[l - 1]);
    cards[l - 1] = v;
  }
  if (!a && l - 3 >= 0 && match(cards[l], cards[l - 3])) {
    v = cards[l - 3];
    cards[l - 3] = cards[l];
    cards.pop_back();
    a = solve(cards);
    cards.push_back(cards[l - 3]);
    cards[l - 3] = v;
  }
  mp[cards] = a;
  return a;
}
int main() {
  int i, n;
  cin >> n;
  cards.resize(n);
  for (i = 0; i < n; ++i) {
    cin >> cards[i];
  }
  if (solve(cards)) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
  return 0;
}
