#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, MOD = 1e9 + 7;
int main() {
  int n, win, p1 = 1, p2 = 2, nex = 3;
  cin >> n;
  while (n--) {
    cin >> win;
    if (p1 != win && p2 != win) {
      cout << "NO\n";
      return 0;
    }
    if (p1 == win) {
      swap(nex, p2);
    } else {
      swap(p1, nex);
    }
  }
  cout << "YES\n";
  return 0;
}
