#include <bits/stdc++.h>
using namespace std;
int n;
int a[100 + 100];
int main() {
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    int flag = 0;
    int b1 = 1, b2 = 2;
    for (int i = 1; i <= n; i++) {
      if (a[i] == b1)
        b2 = 6 - b1 - b2;
      else if (a[i] == b2)
        b1 = 6 - b1 - b2;
      else {
        flag = 1;
        break;
      }
    }
    if (flag)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
