#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  bool state[4] = {0};
  state[1] = state[2] = 1;
  int flag = 1;
  while (n--) {
    int t;
    cin >> t;
    switch (t) {
      case 1:
        if (state[1]) {
          if (state[2]) {
            state[2] = 0;
            state[3] = 1;
          } else {
            state[2] = 1;
            state[3] = 0;
          }
        } else {
          flag = 0;
        }
        break;
      case 2:
        if (state[2]) {
          if (state[1]) {
            state[1] = 0;
            state[3] = 1;
          } else {
            state[1] = 1;
            state[3] = 0;
          }
        } else {
          flag = 0;
        }
        break;
      case 3:
        if (state[3]) {
          if (state[1]) {
            state[1] = 0;
            state[2] = 1;
          } else {
            state[2] = 0;
            state[1] = 1;
          }
        } else {
          flag = 0;
        }
        break;
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
