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