#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cnt, a;
  bool f = true;
  cin >> n;
  cnt = 3;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a != cnt) {
      cnt = 6 - (a + cnt);
    } else {
      f = false;
      break;
    }
  }
  if (f) {
    cout << "YES";
  } else {
    cout << "NO";
  }
  return 0;
}
