#include <bits/stdc++.h>
using namespace std;
const int maxn = 2505;
inline int rnd() { return rand() * 20000 + rand(); }
void IN(int &x) {
  x = 0;
  char ch = getchar();
  bool d = 0;
  while (!isdigit(ch)) {
    if (ch == '-') d = 1;
    ch = getchar();
  }
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  if (d) x = -x;
}
int n, m, q;
struct exBIT {
  int c[maxn][maxn];
  inline void ins(int x, int y, int k) {
    for (int i = x; i <= n; i += i & (-i))
      for (int j = y; j <= m; j += j & (-j)) c[i][j] ^= k;
  }
  inline int ask(int x, int y) {
    int re = 0;
    for (int i = x; i > 0; i -= i & (-i))
      for (int j = y; j > 0; j -= j & (-j)) re ^= c[i][j];
    return re;
  }
} hjx;
struct opt {
  int x1, x2, y1, y2;
  opt(int a, int b, int c, int d) : x1(a), x2(b), y1(c), y2(d) {}
  bool operator<(const opt &rhs) const {
    if (x1 == rhs.x1) {
      if (x2 == rhs.x2) return y1 == rhs.y1 ? y2 < rhs.y2 : y1 < rhs.y1;
      return x2 < rhs.x2;
    }
    return x1 < rhs.x1;
  }
};
map<opt, int> id;
int main() {
  srand(19260817u);
  IN(n), IN(m), IN(q);
  int t, r1, c1, r2, c2;
  while (q--) {
    IN(t), IN(r1), IN(c1), IN(r2), IN(c2);
    if (t == 1) {
      r2++, c2++;
      int tmp = rnd();
      hjx.ins(r1, c1, tmp), hjx.ins(r1, c2, tmp);
      hjx.ins(r2, c1, tmp), hjx.ins(r2, c2, tmp);
      id[opt(r1, c1, r2, c2)] = tmp;
    } else if (t == 2) {
      r2++, c2++;
      int tmp = id[opt(r1, c1, r2, c2)];
      hjx.ins(r1, c1, tmp), hjx.ins(r1, c2, tmp);
      hjx.ins(r2, c1, tmp), hjx.ins(r2, c2, tmp);
      id.erase(opt(r1, c1, r2, c2));
    } else {
      if (hjx.ask(r1, c1) == hjx.ask(r2, c2))
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
