#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  scanf("%d", &N);
  int player1 = 1;
  int player2 = 2;
  int spec = 3;
  while (N--) {
    int w;
    scanf("%d", &w);
    if (w != player1 && w != player2) {
      printf("NO\n");
      return 0;
    }
    if (w == player1) {
      swap(player2, spec);
    } else {
      swap(player1, spec);
    }
  }
  printf("YES\n");
  return 0;
}
