#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, l, w;
  scanf("%lld", &n);
  long long ar[n + 1];
  for (long long i = 0; i < n; i++) scanf("%lld", &ar[i]);
  l = 2, w = 1;
  long long p1 = 1, p2 = 2;
  if (ar[0] == 3) {
    cout << "NO";
    return 0;
  }
  if (ar[0] == 2) {
    w = 2, l = 1;
  }
  for (long long i = 1; i < n; i++) {
    if (ar[i] == l) {
      cout << "NO";
      return 0;
    }
    if (p1 == 1 and p2 == 2 || (p1 == 2 and p2 == 1)) {
      l = 3;
      if (ar[i] == 3) l = w;
      p1 = ar[i], p2 = l;
    } else if (p1 == 1 and p2 == 3 || (p1 == 3 and p2 == 1)) {
      l = 2;
      if (ar[i] == 2) l = w;
      p1 = ar[i], p2 = l;
    } else if (p1 == 2 and p2 == 3 || (p1 == 3 and p2 == 2)) {
      l = 1;
      if (ar[i] == 1) l = w;
      p1 = ar[i], p2 = l;
    }
    w = ar[i];
  }
  cout << "YES";
}
