#include <bits/stdc++.h>
using namespace std;
struct cosa {
  int words;
  int next[26];
};
struct cost {
  double a, b, c;
};
bool operator<(const cost &a, const cost &b) {
  if (a.a == b.a) return a.b < b.b;
  return a.a < b.a;
}
struct q {
  int a, b, c;
};
int alfa, beta;
int tra = 0;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
string vac;
string nig;
string sr;
string ne;
map<string, int> cosa;
map<string, int> vacio;
string buffer;
int main() {
  char prof;
  int x = 0, y, z, c, mal = 2000000000, mil = 0, s = 0, d = -2, a1 = 0, b1, c1,
      x1, y1;
  int a, b;
  cin >> a;
  b = 1;
  c = 2;
  d = 3;
  for (int i = int(0); i < int(a); i++) {
    cin >> x;
    if (b == x) {
      x = c;
      c = d;
      d = x;
    } else {
      if (c == x) {
        x = b;
        b = d;
        d = x;
      } else {
        cout << "NO";
        return 0;
      }
    }
  }
  cout << "YES";
  return 0;
}
