#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
const int INF = 1e9 + 7;
const int base = 10;
int n, a[N];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
  }
  int c = 3, d = 1, s = 2, p;
  for (int i = 1; i <= n; ++i) {
    if (a[i] == s) {
      p = d;
      d = c;
      c = p;
    }
    if (a[i] == d) {
      p = s;
      s = c;
      c = p;
    }
    if (a[i] == c) {
      cout << "NO\n";
      return 0;
    }
  }
  cout << "YES\n";
}
