#include <bits/stdc++.h>
using namespace std;
map<vector<string>, bool> dp[53];
bool DP(int i, vector<string> &s, int n) {
  if (i == n - 1) return 1;
  if (dp[i].find(s) != dp[i].end()) return dp[i][s];
  int now = s.size() - 1;
  string val = s[now];
  s.erase(s.begin() + now);
  string temp;
  bool ret = false;
  if (now - 1 >= 0) {
    if (s[now - 1][1] == val[1] or s[now - 1][0] == val[0])
      temp = s[now - 1], s[now - 1] = val, ret |= DP(i + 1, s, n),
      s[now - 1] = temp;
  }
  if (now - 3 >= 0) {
    if (s[now - 3][1] == val[1] or s[now - 3][0] == val[0])
      temp = s[now - 3], s[now - 3] = val, ret |= DP(i + 1, s, n),
      s[now - 3] = temp;
  }
  s.push_back(val);
  return dp[i][s] = ret;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<string> s(n);
  for (auto &i : s) cin >> i;
  int ans = DP(0, s, n);
  cout << (ans ? "YES" : "NO");
}
