#include <bits/stdc++.h>
using namespace std;
int main() {
  int nQ;
  bool inPlay[3] = {true, true, false};
  int sp = 2, tmp;
  bool bisa = true;
  scanf("%d", &nQ);
  while (nQ--) {
    scanf("%d", &tmp);
    tmp--;
    if (tmp == sp) {
      bisa = false;
      break;
    }
    for (int i = 0; i < 3; i++) {
      inPlay[i] = false;
    }
    inPlay[tmp] = true;
    inPlay[sp] = true;
    for (int i = 0; i < 3; i++) {
      if (inPlay[i] == false) {
        sp = i;
      }
    }
  }
  if (bisa) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}
