#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, b, c;
  cin >> n;
  int x = 1;
  int y = 2;
  int z = 3;
  bool res = true;
  for (int i = 0; i < n; i++) {
    int q;
    cin >> q;
    if (q != x && q != y)
      res = false;
    else if (q == x)
      swap(y, z);
    else
      swap(x, z);
  }
  (res) ? cout << "YES" : cout << "NO";
  cout << endl;
  return 0;
}
