#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, s = 3, p1 = 1, p2 = 2, i, j;
  int a[4];
  a[1] = 1;
  a[2] = 1;
  a[3] = 0;
  cin >> n;
  for (i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (s == x) {
      cout << "NO\n";
      return 0;
    }
    p1 = x;
    p2 = s;
    for (j = 1; j <= 3; j++) {
      if (a[j] == 1 && x != j) {
        s = j;
      }
    }
    a[p2] = 1;
    a[s] = 0;
  }
  cout << "YES\n";
}
