#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    int m1 = 1, m2 = 2, p = 3, flag = 0, t;
    int win;
    for (int i = 0; i < n; i++) {
      scanf("%d", &win);
      if (win == m1) {
        t = m2;
        m2 = p;
        p = t;
        continue;
      } else if (win == m2) {
        t = m1;
        m1 = p;
        p = t;
        continue;
      } else
        flag = 1;
    }
    if (flag)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
