#include <bits/stdc++.h>
using namespace std;
long long n, m, a[2569][2569], fw[2569][2569], fi, fj;
void ud(long long y, long long x, long long w) {
  for (fi = y; fi <= n; fi += fi & -fi) {
    for (fj = x; fj <= m; fj += fj & -fj) {
      fw[fi][fj] ^= w;
    }
  }
}
long long qr(long long y, long long x) {
  long long z = 0;
  for (fi = y; fi; fi -= fi & -fi) {
    for (fj = x; fj; fj -= fj & -fj) {
      z ^= fw[fi][fj];
    }
  }
  return z;
}
int main() {
  long long t, rr, i, j, ky, k, y, x, y2, x2;
  scanf("%lld%lld%lld", &n, &m, &t);
  for (rr = 0; rr < t; rr++) {
    scanf("%lld%lld%lld%lld%lld", &ky, &y, &x, &y2, &x2);
    if (ky <= 2) {
      if (ky == 1) {
        k = (rand() << 15) | rand();
      } else if (ky == 2) {
        k = a[y][x];
      }
      a[y][x] ^= k;
      ud(y, x, k);
      ud(y2 + 1, x, k);
      ud(y, x2 + 1, k);
      ud(y2 + 1, x2 + 1, k);
    } else if (ky == 3) {
      if (qr(y, x) == qr(y2, x2)) {
        printf("Yes\n");
      } else {
        printf("No\n");
      }
    }
  }
}
