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