#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<pair<int, int> > pl;
  pl.push_back(make_pair(1, 2));
  int v = 3;
  for (int i = 0; i < n; i++) {
    if (a[i] == v) {
      cout << "NO";
      return 0;
    } else if (a[i] == pl[i].first) {
      pl.push_back(make_pair(pl[i].first, v));
      v = pl[i].second;
    } else if (a[i] == pl[i].second) {
      pl.push_back(make_pair(v, pl[i].second));
      v = pl[i].first;
    }
  }
  cout << "YES";
}
