#include <bits/stdc++.h>
using namespace std;
int fun(int a, int bb) {
  if (a == 1 && bb == 2 || a == 2 && bb == 1) return 3;
  if (a == 1 && bb == 3 || a == 3 && bb == 1) return 2;
  if (a == 3 && bb == 2 || a == 2 && bb == 3) return 1;
}
int main() {
  int n;
  cin >> n;
  int P1 = 1, P2 = 2;
  int tt;
  bool flag = true;
  for (int i = 0; i < n; i++) {
    cin >> tt;
    if (P1 == tt || P2 == tt) {
      if (P1 == tt) {
        P2 = fun(P1, P2);
      } else {
        P1 = fun(P1, P2);
      }
    } else {
      flag = false;
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
