#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[109], sol = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int winner, loser, spect;
  for (int i = 0; i < n; i++) {
    if (i == 0) {
      winner = a[i];
      if (winner == 1) {
        loser = 2;
        spect = 3;
      } else if (winner == 2) {
        loser = 1;
        spect = 3;
      } else {
        sol = 0;
        break;
      }
      continue;
    }
    if (a[i] == loser) {
      sol = 0;
      break;
    }
    if (spect == a[i])
      loser = winner;
    else
      loser = spect;
    winner = a[i];
    if (winner != 1 && loser != 1) spect = 1;
    if (winner != 2 && loser != 2) spect = 2;
    if (winner != 3 && loser != 3) spect = 3;
  }
  if (sol == 0)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
