#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j, a1 = 1, a2 = 2;
  scanf("%d", &n);
  int a[3] = {1, 2, 3};
  for (i = 0; i < n; i++) {
    int bil;
    scanf("%d", &bil);
    if (bil == a1 || bil == a2) {
      int yangBelum;
      for (j = 0; j < 3; j++) {
        if (a[j] != a1 && a[j] != a2) {
          yangBelum = a[j];
          break;
        }
      }
      if (bil == a1) {
        a2 = yangBelum;
      } else {
        a1 = yangBelum;
      }
    } else {
      printf("NO\n");
      return 0;
    }
  }
  printf("YES\n");
  return 0;
};
