#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, w, a, s = 3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    if (a == s) {
      cout << "NO";
      return 0;
    }
    s = 6 - a - s;
  }
  cout << "YES";
}
