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