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