#include <bits/stdc++.h>
using namespace std;
const int N = 500005;
int main() {
  int n;
  cin >> n;
  int a = 1, b = 2, c = 3;
  bool ok = 1;
  while (n--) {
    int x;
    cin >> x;
    if (x != a && x != b) ok = 0;
    if (x == a) swap(b, c);
    if (x == b) swap(a, c);
  }
  if (ok)
    cout << "YES";
  else
    cout << "NO";
}
