#include <bits/stdc++.h>
using namespace std;
vector<long long> v;
vector<string> str;
string s;
char c;
int dp[1];
long long n, z, k, nab;
int main() {
  cin >> n;
  nab = 3;
  for (int i = 0; i < n; i++) {
    cin >> z;
    if (z != nab) {
      if (nab == 1 && z == 2) {
        nab = 3;
      } else {
        if (nab == 2 && z == 3) {
          nab = 1;
        } else {
          if (nab == 1 && z == 3) {
            nab = 2;
          } else {
            if (nab == 2 && z == 1) {
              nab = 3;
            } else {
              if (nab == 3 && z == 2) {
                nab = 1;
              } else {
                if (nab == 3 && z == 1) {
                  nab = 2;
                }
              }
            }
          }
        }
      }
    } else {
      cout << "NO";
      return 0;
    }
  }
  cout << "YES";
  return 0;
}
