#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d = 1, k, m = 0, y, a = 1, b = 2, c = 3;
  string s;
  cin >> n;
  int aa[n];
  for (int i = 0; i < n; i++) cin >> aa[i];
  for (int i = 0; i < n; i++) {
    if (aa[i] == c) {
      cout << "NO" << endl;
      return 0;
    }
    if (aa[i] == a)
      swap(b, c);
    else
      swap(a, c);
  }
  cout << "YES" << endl;
}
