#include <bits/stdc++.h>
using namespace std;
bool solve(long long int n) {
  long long int s1 = 1, s2 = 1, s3 = 0, x;
  vector<long long int> v;
  for (long long int i = 0; i < n; i++) {
    cin >> x, v.push_back(x);
  }
  long long int i = 0;
  while (i < n) {
    x = v[i];
    i++;
    if (s1 == 0 && x == 1) return false;
    if (s2 == 0 && x == 2) return false;
    if (s3 == 0 && x == 3) return false;
    if (s1 == 1 && s2 == 1) {
      if (x == 1)
        s2 = 0, s3 = 1;
      else {
        s1 = 0;
        s3 = 1;
      }
    } else if (s2 == 1 && s3 == 1) {
      if (x == 2)
        s3 = 0, s1 = 1;
      else {
        s1 = 1;
        s2 = 0;
      }
    } else {
      if (x == 3)
        s1 = 0, s2 = 1;
      else {
        s2 = 1;
        s3 = 0;
      }
    }
  }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  if (solve(n))
    cout << "YES\n";
  else {
    cout << "NO\n";
  }
  return 0;
}
