#include <bits/stdc++.h>
using namespace std;
map<pair<pair<int, int>, pair<int, int> >, int> h;
const int Maxn = 2510;
const int base = 233;
int read() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + ch - '0';
    ch = getchar();
  }
  return x * f;
}
int s[Maxn][Maxn], Pow[100010];
int n, m, q;
void add(int x, int y, int z) {
  for (int i = x; i <= n; i += (i & -i))
    for (int j = y; j <= m; j += (j & -j)) s[i][j] += z;
}
int getsum(int x, int y) {
  int re = 0;
  for (int i = x; i; i -= (i & -i))
    for (int j = y; j; j -= (j & -j)) re += s[i][j];
  return re;
}
int main() {
  n = read();
  m = read();
  q = read();
  Pow[0] = 1;
  for (int i = 1; i <= 100000; i++) Pow[i] = Pow[i - 1] * base;
  while (q--) {
    int op = read(), r1 = read(), c1 = read(), r2 = read(), c2 = read();
    if (op == 1) {
      h[make_pair(make_pair(r1, c1), make_pair(r2, c2))] = q;
      add(r1, c1, Pow[q]);
      add(r2 + 1, c1, -Pow[q]);
      add(r1, c2 + 1, -Pow[q]);
      add(r2 + 1, c2 + 1, Pow[q]);
    } else if (op == 2) {
      int o = h[make_pair(make_pair(r1, c1), make_pair(r2, c2))];
      add(r1, c1, -Pow[o]);
      add(r2 + 1, c1, Pow[o]);
      add(r1, c2 + 1, Pow[o]);
      add(r2 + 1, c2 + 1, -Pow[o]);
    } else {
      int n1 = getsum(r1, c1), n2 = getsum(r2, c2);
      if (n1 == n2)
        puts("Yes");
      else
        puts("No");
    }
  }
}
