#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int ans = 3;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    if (x == ans) {
      cout << "NO\n";
      return 0;
    }
    ans = 6 - x - ans;
  }
  cout << "YES\n";
  return 0;
}
