#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, spect = 3, flag = 1, loser;
  cin >> n;
  int win[n];
  for (int i = 0; i < n; i++) cin >> win[i];
  int i = 0;
  if (win[0] == 3)
    flag = 0;
  else {
    while (n--) {
      loser = 6 - win[i] - spect;
      if (loser == win[i + 1]) {
        flag = 0;
        break;
      }
      spect = loser;
      i++;
    }
  }
  if (flag)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
