#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y);
long long gcd(long long a, long long b);
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  long long cp1 = 1, cp2 = 2, cs = 3, f = 0;
  for (long long i = 0; i < n; i++) {
    long long a;
    cin >> a;
    if (a == cp1) {
      swap(cp2, cs);
    } else if (a == cp2) {
      swap(cp1, cs);
    } else
      f = 1;
  }
  if (f == 1)
    cout << "NO\n";
  else
    cout << "YES\n";
}
long long power(long long x, long long y) {
  long long res = 1;
  x %= 998244353;
  while (y > 0) {
    if (y & 1) res = (res * x) % 998244353;
    y = y >> 1;
    x = (x * x) % 998244353;
  }
  return res % 998244353;
}
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
