#include <bits/stdc++.h>
using namespace std;
set<tuple<int, int, int>> s[2505];
map<int, int> idx[2505];
int foo(int x, int y) {
  for (int j = x; j; j--) {
    for (auto b : s[j]) {
      int u, r, d;
      tie(u, r, d) = b;
      if (x <= r && u <= y && y <= d) return idx[j][u];
    }
  }
  return 0;
}
int main() {
  int n, m, q, z = 1;
  scanf("%d%d%d", &n, &m, &q);
  while (q--) {
    int t, l, u, r, d;
    scanf("%d%d%d%d%d", &t, &l, &u, &r, &d);
    if (t == 1) {
      s[l].emplace(u, r, d);
      idx[l][u] = z++;
    } else if (t == 2)
      s[l].erase(make_tuple(u, r, d));
    else {
      int a = foo(l, u), b = foo(r, d);
      puts(a == b ? "Yes" : "No");
    }
  }
}
