#include <bits/stdc++.h>
using namespace std;
inline int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  int s = 3;
  bool ok = true;
  while (n--) {
    int w;
    cin >> w;
    if (w == s)
      ok = false;
    else
      s = 6 - w - s;
  }
  if (ok)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
