#include <bits/stdc++.h>
using namespace std;
int sum, c, t, arr[4] = {0, 1, 2, 3};
bool z = 0;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  while (n--) {
    int x;
    cin >> x;
    if (x == arr[1] || x == arr[2]) {
      if (x == arr[1])
        swap(arr[2], arr[3]);
      else if (x == arr[2])
        swap(arr[1], arr[3]);
    } else
      z = 1;
  }
  if (z == 1)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
