#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, p = 1;
  char c = getchar();
  for (; !isdigit(c); c = getchar())
    if (c == '-') p = -1;
  for (; isdigit(c); c = getchar()) x = (x << 1) + (x << 3) + (c ^ 48);
  return x * p;
}
inline void File() {
  freopen("CF869E.in", "r", stdin);
  freopen("CF869E.out", "w", stdout);
}
const int N = 2500 + 10;
int aa, bb, cc, dd, n, m, q;
struct BIT {
  long long c[N][N];
  inline void add(int x, int y, long long v) {
    for (int tx = x; tx <= n; tx += tx & -tx)
      for (int ty = y; ty <= m; ty += ty & -ty) c[tx][ty] += v;
  }
  inline long long query(int x, int y) {
    long long res = 0;
    for (int tx = x; tx; tx -= tx & -tx)
      for (int ty = y; ty; ty -= ty & -ty) res += c[tx][ty];
    return res;
  }
  inline void update(int a, int b, int c, int d, int ty) {
    long long v = 1ll * a * aa + 1ll * b * bb + 1ll * c * cc + 1ll * d * dd;
    v *= ty;
    add(a, b, v), add(c + 1, d + 1, v);
    add(c + 1, b, -v), add(a, d + 1, -v);
  }
} T;
int main() {
  n = read(), m = read(), q = read();
  srand(time(0)), aa = rand(), bb = rand(), cc = rand(), dd = rand();
  for (int a, b, c, d, op; q--;) {
    op = read(), a = read(), b = read(), c = read(), d = read();
    if (op == 1) T.update(a, b, c, d, 1);
    if (op == 2) T.update(a, b, c, d, -1);
    if (op == 3) puts(T.query(a, b) == T.query(c, d) ? "Yes" : "No");
  }
  return 0;
}
