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