#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, c, d, f;
  cin >> n;
  int a[n];
  for (i = 0; i < n; i++) cin >> a[i];
  if (a[0] == 3) {
    cout << "No";
    return 0;
  }
  c = 1;
  d = 2;
  for (i = 0; i < n; i++) {
    if (a[i] == c || a[i] == d) {
      f = c;
      c = a[i];
      if (f == 1 && d == 2 || f == 2 && d == 1)
        d = 3;
      else if (f == 1 && d == 3 || f == 3 && d == 1)
        d = 2;
      else
        d = 1;
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
}
