#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e9;
int main() {
  int n;
  cin >> n;
  vector<int> w(n);
  for (int i = 0; i < n; i++) {
    cin >> w[i];
  }
  int p1, p2, wat;
  p1 = 1;
  p2 = 2;
  wat = 3;
  bool c = true;
  for (int i = 0; i < n; i++) {
    if (w[i] != p1 && w[i] != p2) {
      c = false;
    }
    if (p1 == w[i]) {
      swap(p2, wat);
    }
    if (p2 == w[i]) {
      swap(p1, wat);
    }
  }
  if (c == true) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}
