#include <bits/stdc++.h>
using namespace std;
int f(int a, int v, int b) {
  if (a == v) {
    return b;
  } else {
    return a;
  }
}
int main() {
  int n, a = 1, b = 2, c = 3, v, t;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v;
    if (v == c) {
      cout << "NO";
      return 0;
    }
    t = f(a, v, b);
    b = c;
    a = v;
    c = t;
  }
  cout << "YES";
  return 0;
}
