#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int p1 = 1, p2 = 2, rem = 3;
  ;
  int x;
  int f = 1;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x != p1 && x != p2) {
      f = 0;
    } else {
      if (x == p1) {
        int tmp = p2;
        p2 = rem;
        rem = tmp;
      } else {
        int tmp = p1;
        p1 = rem;
        rem = tmp;
      }
    }
  }
  if (f)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
