#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int MOD = 1000000007;
const int MOD1 = 1000000009;
map<vector<string>, bool> y;
void solve1(vector<string> v) {
  if (v.size() == 1) {
    cout << "YES";
    exit(0);
  }
  if (y.find(v) != y.end()) return;
  y[v] = 1;
  long long int n = v.size();
  n--;
  if (v[n - 1][0] == v[n][0] || v[n - 1][1] == v[n][1]) {
    string d = v[n];
    string d1 = v[n - 1];
    v[n - 1] = v[n];
    v.pop_back();
    solve1(v);
    v.push_back(d);
    v[n - 1] = d1;
  }
  if (n - 3 >= 0 && (v[n - 3][0] == v[n][0] || v[n - 3][1] == v[n][1])) {
    v[n - 3] = v[n];
    v.pop_back();
    solve1(v);
  }
}
void solve() {
  long long int n;
  cin >> n;
  vector<string> v;
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  solve1(v);
  cout << "NO\n";
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  srand(time(NULL));
  ;
  long long int t = 1;
  while (t--) {
    solve();
  }
}
