#include <bits/stdc++.h>
int main(void) {
  int n;
  scanf("%d", &n);
  int p1 = 1, p2 = 2, s = 3;
  bool isit = true;
  for (int i = 0; i != n; i++) {
    int x;
    scanf("%d", &x);
    if (x == p1) {
      int tmp = p2;
      p2 = s;
      s = tmp;
    } else if (x == p2) {
      int tmp = p1;
      p1 = s;
      s = tmp;
    } else {
      isit = false;
    }
  }
  if (isit)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
