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