#include <bits/stdc++.h>
using namespace std;
template <typename T>
void dbg(T t) {
  cerr << t << endl;
}
template <typename T, typename... Args>
void dbg(T t, Args... args) {
  cerr << t << " ";
  dbg(args...);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, a, spec = 3;
  int t[2] = {1, 2};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (spec == a) {
      cout << "NO" << endl;
      return 0;
    }
    for (int j = 0; j < 2; j++)
      if (t[j] != a) swap(t[j], spec);
  }
  cout << "YES" << endl;
  return 0;
}
