#include <bits/stdc++.h>
using namespace std;
const int N = 2505;
unsigned long long su[N][N];
int lowbit(int x) { return x & (-x); }
unsigned long long ask(int x, int y) {
  unsigned long long ret = 0;
  for (int i = x; i > 0; i -= lowbit(i)) {
    for (int j = y; j > 0; j -= lowbit(j)) {
      ret ^= su[i][j];
    }
  }
  return ret;
}
unsigned long long modify(int x, int y, unsigned long long v) {
  for (int i = x; i <= 2500; i += lowbit(i)) {
    for (int j = y; j <= 2500; j += lowbit(j)) {
      su[i][j] ^= v;
    }
  }
}
map<tuple<int, int, int, int>, unsigned long long> id;
unsigned long long RAND() { return (rand() << 15) + rand(); }
int main() {
  srand(time(0));
  int x, y, q;
  scanf("%d%d%d", &x, &y, &q);
  while (q--) {
    int op, xa, ya, xb, yb;
    scanf("%d%d%d%d%d", &op, &xa, &ya, &xb, &yb);
    if (op == 1 || op == 2) {
      xa++;
      ya++;
      xb++;
      yb++;
      if (!id.count(tuple<int, int, int, int>{xa, ya, xb, yb}))
        id[tuple<int, int, int, int>{xa, ya, xb, yb}] = RAND();
      unsigned long long uid = id[tuple<int, int, int, int>{xa, ya, xb, yb}];
      modify(xa - 1, ya - 1, uid);
      modify(xb, yb, uid);
      modify(xa - 1, yb, uid);
      modify(xb, ya - 1, uid);
    } else {
      unsigned long long ret1 = ask(xa, ya);
      unsigned long long ret2 = ask(xb, yb);
      if (ret1 == ret2)
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
