#include <bits/stdc++.h>
using namespace std;
int n, x;
int main() {
  int loser = 0;
  cin >> n;
  cin >> x;
  if (x == 1)
    loser = 2;
  else if (x == 2)
    loser = 1;
  else {
    cout << "NO\n";
    return 0;
  }
  for (int i = 1; i < n; i++) {
    cin >> x;
    if (x == loser) {
      cout << "NO\n";
      return 0;
    }
    if ((loser == 1 && x == 2) || (loser == 2 && x == 1))
      loser = 3;
    else if ((loser == 1 && x == 3) || (loser == 3 && x == 1))
      loser = 2;
    else if ((loser == 2 && x == 3) || (loser == 3 && x == 2))
      loser = 1;
  }
  cout << "YES\n";
  return 0;
}
