#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2505;
const int MAXM = 1e5 + 5;
const int oo = 0x3f3f3f3f;
int N, M, Q, cnt = 0;
unsigned long long rnd[MAXM];
struct Rec {
  int xa, xb, ya, yb;
  Rec() {}
  Rec(int xa, int xb, int ya, int yb) : xa(xa), ya(xb), xb(xb), yb(yb) {}
  bool operator<(const Rec o) const {
    if (xa == o.xa && xb == o.xb && ya == o.ya) return yb < o.yb;
    if (xa == o.xa && xb == o.xb) return ya < o.ya;
    if (xa == o.xa) return xb < o.xb;
    return xa < o.xa;
  }
  bool operator==(const Rec o) const {
    return xa == o.xa && xb == o.xb && ya == o.ya && yb == o.yb;
  }
};
map<Rec, int> ID;
unsigned long long c[MAXN][MAXN];
int lowbit(int i) { return i & (-i); }
void upd(int x, int y, unsigned long long v) {
  for (int i = x; i <= N; i += lowbit(i))
    for (int j = y; j <= M; j += lowbit(j)) c[i][j] ^= v;
}
unsigned long long calc(int x, int y) {
  unsigned long long cur = 0;
  for (int i = x; i >= 1; i -= lowbit(i))
    for (int j = y; j >= 1; j -= lowbit(j)) cur ^= c[i][j];
  return cur;
}
namespace solution {
unsigned long long getrnd() {
  unsigned long long cur = 0;
  for (int i = 0; i <= 10; i++) cur = (cur << 16) ^ rand();
  return cur;
}
void Solve() {
  scanf("%d%d%d", &N, &M, &Q);
  while (Q--) {
    int op, xa, xb, ya, yb;
    scanf("%d%d%d%d%d", &op, &xa, &ya, &xb, &yb);
    if (op == 1) {
      Rec cur = Rec(xa, xb, ya, yb);
      if (!ID[cur]) {
        ID[cur] = ++cnt;
        rnd[cnt] = getrnd();
      }
      unsigned long long v = rnd[ID[cur]];
      upd(xb + 1, yb + 1, v);
      upd(xa, ya, v);
      upd(xa, yb + 1, v);
      upd(xb + 1, ya, v);
    }
    if (op == 2) {
      int o = ID[Rec(xa, xb, ya, yb)];
      unsigned long long v = rnd[o];
      upd(xb + 1, yb + 1, v);
      upd(xa, ya, v);
      upd(xa, yb + 1, v);
      upd(xb + 1, ya, v);
    }
    if (op == 3) {
      puts(calc(xa, ya) == calc(xb, yb) ? "Yes" : "No");
    }
  }
}
}  // namespace solution
int main() {
  using namespace solution;
  srand(19260817);
  Solve();
  return 0;
}
