#include <bits/stdc++.h>
using namespace std;
struct square {
  int r1, c1, r2, c2;
  square(int R1, int C1, int R2, int C2) {
    r1 = R1;
    c1 = C1;
    r2 = R2;
    c2 = C2;
  }
  bool same(int R1, int C1, int R2, int C2) {
    if (R1 != r1) return false;
    if (C1 != c1) return false;
    if (R2 != r2) return false;
    if (C2 != c2) return false;
    return true;
  }
  bool in(int x, int y) {
    if (r1 <= x && x <= r2 && c1 <= y && y <= c2) return true;
    return false;
  }
};
vector<square *> S;
int main(void) {
  int n, m, q;
  scanf("%d %d %d", &n, &m, &q);
  while (q--) {
    int op;
    scanf("%d", &op);
    int r1, c1, r2, c2;
    scanf("%d %d %d %d", &r1, &c1, &r2, &c2);
    if (op == 1) {
      square *s = new square(r1, c1, r2, c2);
      S.push_back(s);
    } else if (op == 2) {
      int size = S.size();
      for (int i = 0; i < size; i++) {
        square *s = S[i];
        if (s->same(r1, c1, r2, c2)) {
          S.erase(S.begin() + i);
          break;
        }
      }
    } else if (op == 3) {
      bool find = false;
      for (square *s : S)
        if (s->in(r1, c1) != s->in(r2, c2)) {
          printf("No\n");
          find = true;
          break;
        }
      if (!find) printf("Yes\n");
    }
  }
  return 0;
}
