#include <bits/stdc++.h>
using namespace std;
int main() {
  istream &in = cin;
  int n;
  bool flag = true;
  in >> n;
  int p[3] = {1, 2, 3};
  int tmp;
  for (int i = 0; i < n; ++i) {
    in >> tmp;
    if (tmp == p[0]) {
      swap(p[1], p[2]);
    } else if (tmp == p[1]) {
      swap(p[0], p[2]);
    } else {
      flag = false;
      break;
    }
  }
  if (flag) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  cin >> n;
  return 0;
}
