#include <bits/stdc++.h>
using namespace std;
int n, x, c, a, b;
bool s = true;
int main() {
  cin >> n;
  a = 1;
  b = 2;
  c = 6;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (s) {
      if (x != a && x != b) {
        s = false;
        cout << "NO" << endl;
      } else {
        if (a == x)
          b = c - a - b;
        else
          a = c - b - a;
      }
    }
  }
  if (s) cout << "YES" << endl;
  return 0;
}
