#include <bits/stdc++.h>
int main() {
  int n, i;
  int ar[101];
  int spec = 0;
  scanf("%d", &n);
  for (i = 0; i < n; i++) scanf("%d", &ar[i]);
  spec = 3;
  for (i = 0; i < n; i++) {
    if (ar[i] == spec) {
      printf("NO\n");
      return 0;
    } else if (ar[i] == 1) {
      if (spec == 2)
        spec = 3;
      else if (spec == 3)
        spec = 2;
      else {
        printf("NO\n");
        return 0;
      }
    } else if (ar[i] == 2) {
      if (spec == 1)
        spec = 3;
      else if (spec == 3)
        spec = 1;
      else {
        printf("NO\n");
        return 0;
      }
    } else if (ar[i] == 3) {
      if (spec == 1)
        spec = 2;
      else if (spec == 2)
        spec = 1;
      else {
        printf("NO\n");
        return 0;
      }
    }
  }
  printf("YES\n");
  return 0;
}
