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