#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int p[2] = {1, 2};
  int other = 3;
  int won, aux;
  bool no = false;
  for (int i = 0; i < n; ++i) {
    cin >> won;
    if (no) continue;
    if (won == other) {
      no = true;
      continue;
    }
    int idx = 1;
    if (won != p[0]) idx = 0;
    aux = other;
    other = p[idx];
    p[idx] = aux;
  }
  if (no)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
