#include <bits/stdc++.h>
using namespace std;
long long a[1000001], n, m = INT_MIN, b, c, k1, c1, r, l, x, m1 = INT_MAX, p1,
                         p, k, t, tx1 = -1, ty1 = -1, tx2 = -1, ty2 = -1, a1,
                         b1;
double qx;
string s, s1, s2;
char q;
set<char> w, e;
bool u[1000001];
pair<long long, pair<long long, long long> > d[1000001];
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  if (a[1] == 3) return cout << "NO", 0;
  r = a[1];
  l = 3 - r;
  for (int i = 2; i <= n; i++) {
    if (a[i] == l) return cout << "NO", 0;
    if (a[i] != r)
      l = r, r = a[i];
    else
      l = 6 - l - r;
  }
  cout << "YES";
}
