#include <bits/stdc++.h>
using namespace std;
pair<int, int> getVal(string a) {
  string s = "23456789TJQKA";
  string t = "SDHC";
  return {s.find(a[0]), t.find(a[1])};
}
bool can(pair<int, int> a, pair<int, int> b) {
  return a.first == b.first || a.second == b.second;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    string nxt;
    cin >> nxt;
    v.push_back(getVal(nxt));
  }
  reverse(v.begin(), v.end());
  if (n == 1) {
    cout << "YES";
    return 0;
  }
  if (n == 2) {
    if (can(v[0], v[1])) {
      cout << "YES";
    } else {
      cout << "NO";
    }
    return 0;
  }
  if (n == 3) {
    if (can(v[0], v[1]) && can(v[0], v[2])) {
      cout << "YES";
    } else {
      cout << "NO";
    }
    return 0;
  }
  set<vector<pair<int, int> > > arr = {{v[0], v[1], v[2]}};
  for (int i = 3; i < n; i++) {
    set<vector<pair<int, int> > > nxt;
    if (arr.size() == 0) {
      cout << "NO";
      return 0;
    }
    for (auto cur : arr) {
      if (can(cur[0], v[i])) {
        nxt.insert({cur[1], cur[2], cur[0]});
      }
      if (can(cur[0], cur[1])) {
        nxt.insert({cur[0], cur[2], v[i]});
      }
    }
    arr = nxt;
  }
  for (auto cur : arr) {
    if (can(cur[0], cur[1]) && can(cur[2], cur[0])) {
      cout << "YES";
      return 0;
    }
  }
  cout << "NO";
  return 0;
}
