#include <bits/stdc++.h>
using namespace std;
int a[1007];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int b = 3;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == b) {
      cout << "NO";
      return 0;
    }
    for (int j = 1; j <= 3; j++) {
      if (j != a[i] && j != b) {
        b = j;
        break;
      }
    }
  }
  cout << "YES";
  return 0;
}
