#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, a = 1, b = 2, s = 1, c = 3, w, t;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> w;
    if (w != a && w != b) {
      s = 0;
      break;
    } else if (w == a) {
      t = b;
      b = c;
      c = t;
    } else {
      t = a;
      a = c;
      c = t;
    }
  }
  if (!s)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
