#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > players;
int main() {
  int n, w;
  cin >> n;
  pair<int, int> p = make_pair(1, 2);
  players.push_back(p);
  for (int i = 0; i < n; i++) {
    cin >> w;
    if (w != players[i].first && w != players[i].second) {
      cout << "NO" << endl;
      break;
    } else {
      for (int j = 1; j < 4; j++) {
        if (j != players[i].first && j != players[i].second) {
          int s = j;
          pair<int, int> pp = make_pair(j, w);
          players.push_back(pp);
        }
      }
    }
    if (i == n - 1) {
      cout << "YES" << endl;
      break;
    }
  }
  return 0;
}
