#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, playerA = 1, playerB = 2, rest = 3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a != playerA && a != playerB) {
      return cout << "NO", 0;
    }
    if (a == playerA) {
      swap(playerB, rest);
    } else {
      swap(playerA, rest);
    }
  }
  cout << "YES";
  return 0;
}
