#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  bool yes = 1;
  int p1 = 1, p2 = 2, tmp = 3;
  for (int i = 0; i < n; i++) {
    if (A[i] != p1 && A[i] != p2) {
      yes = 0;
    } else {
      if (A[i] == p1)
        swap(p2, tmp);
      else
        swap(p1, tmp);
    }
  }
  puts(yes ? "YES" : "NO");
}
