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