#include <bits/stdc++.h>
using namespace std;
int main() {
  int a = 1, b = 2, v = 3, n, pr, p;
  int p1 = a, p2 = b, na = v;
  bool t = true;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> p;
    if (p == na) {
      t = false;
      break;
    } else {
      if (p == p1) {
        p1 = p;
        pr = p2;
        p2 = na;
        na = pr;
      } else {
        p2 = p;
        pr = p1;
        p1 = na;
        na = pr;
      }
    }
  }
  if (t == true)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
