#include <bits/stdc++.h>
using namespace std;
int n, x, a = 1, b = 2, c = 3;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x;
    if (x == a)
      swap(b, c);
    else if (x == b)
      swap(a, c);
    else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
