#include <bits/stdc++.h>
using namespace std;
using Long = long long;
using ULong = unsigned long long;
vector<int> readIntVec(int size) {
  vector<int> result(size, 0);
  for (int i = 0; i < size; ++i) {
    cin >> result[i];
  }
  return result;
}
int main() {
  const int A = 1, B = 2, C = 3;
  int n = 0;
  cin >> n;
  auto vec = readIntVec(n);
  if (vec[0] == C) {
    cout << "NO";
    return 0;
  }
  int winner = vec[0];
  int loser = vec[0] == A ? B : A;
  int spec = C;
  for (int i = 1; i < vec.size(); ++i) {
    if (vec[i] == loser) {
      cout << "NO";
      return 0;
    }
    spec = loser;
    winner = vec[i];
    loser = A + B + C - spec - winner;
  }
  cout << "YES";
  return 0;
}
