#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int cur = 3;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    if (a == cur) {
      cout << "NO";
      return 0;
    }
    cur ^= a;
  }
  cout << "YES";
  return 0;
}
