#include <bits/stdc++.h>
using namespace std;
int n, a[102], v[4];
int main() {
  int i, aux;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> a[i];
  v[1] = 1;
  v[2] = 1;
  for (i = 1; i <= n; i++) {
    if (v[a[i]] == 0) {
      cout << "NO\n";
      return 0;
    } else {
      if (a[i] == 1)
        swap(v[2], v[3]);
      else if (a[i] == 2)
        swap(v[1], v[3]);
      else
        swap(v[1], v[2]);
    }
  }
  cout << "YES\n";
  return 0;
}
