#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int w;
  int s = 3;
  int p1 = 1, p2 = 2;
  int l;
  bool flag = true;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> w;
    if (w == p1) {
      l = p2;
      p1 = w;
      p2 = s;
      s = l;
    } else if (w == p2) {
      l = p1;
      p1 = w;
      p2 = s;
      s = l;
    } else {
      flag = false;
    }
  }
  if (flag == true) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
