#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, n;
  cin >> n;
  int log[n];
  for (i = 0; i < n; i++) cin >> log[i];
  int w, l, s, p[2];
  i = 0;
  p[0] = 1;
  p[1] = 2;
  w = log[0];
  if (w != 1 && w != 2) {
    cout << "NO";
    return 0;
  }
  l = p[0] + p[1] - w;
  s = 6 - w - l;
  i++;
  while (i < n) {
    p[0] = w;
    p[1] = s;
    if (log[i] == w || log[i] == s) {
      l = p[0] + p[1] - log[i];
      w = log[i];
      s = 6 - l - w;
    } else {
      cout << "NO";
      return 0;
    }
    i++;
  }
  cout << "YES";
  return 0;
}
