#include <bits/stdc++.h>
using namespace std;
const std::string alphabetLower = "abcdefghijklmnopqrstuvwxyz";
const std::string alphabetHigher = "ABCDEFGHIJKLMNOPQRSTUVXYZ";
const std::string digits = "0123456789";
ifstream fin("input.txt");
ofstream fout("output.txt");
void run() {
  int n;
  cin >> n;
  bool w[] = {1, 1, 0};
  for (; n > 0; n--) {
    int a;
    cin >> a;
    if (!w[--a]) {
      cout << "NO";
      return;
    }
    w[(a + 1) % 3] = !w[(a + 1) % 3];
    w[(a + 2) % 3] = !w[(a + 2) % 3];
  }
  cout << "YES";
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  run();
  return 0;
}
