#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  bool game[4];
  scanf("%d", &N);
  int aux;
  game[1] = true;
  game[2] = true;
  game[3] = false;
  for (int i = 0; i < N; i++) {
    scanf("%d", &aux);
    if (!game[aux]) {
      printf("NO\n");
      return 0;
    } else {
      game[1] = !game[1];
      game[2] = !game[2];
      game[3] = !game[3];
      game[aux] = true;
    }
  }
  printf("YES\n");
  return 0;
}
