#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
static long long gcd(long long x, long long y) {
  return y == 0 ? x : gcd(y, x % y);
}
static long long pwm(long long x, long long n, long long m) {
  long long r = 1;
  while (n) {
    if (n & 1) r = r * x % m;
    x = x * x % m;
    n >>= 1;
  }
  return r;
}
int solve() {
  int n, m, q, t, a, b, c, d;
  set<tuple<int, int, int, int> > s;
  scanf("%d%d%d", &n, &m, &q);
  while (q--) {
    scanf("%d%d%d%d%d", &t, &a, &b, &c, &d);
    if (t == 1)
      s.insert(std::make_tuple(a, b, c, d));
    else if (t == 2)
      s.erase(std::make_tuple(a, b, c, d));
    else {
      bool o = 0;
      for (const auto& i : s) {
        int a_ = std::get<0>(i), b_ = std::get<1>(i), c_ = std::get<2>(i),
            d_ = std::get<3>(i);
        o |= (a_ <= a && a <= c_ && b_ <= b && b <= d_) ^
             (a_ <= c && c <= c_ && b_ <= d && d <= d_);
      }
      puts(o ? "No" : "Yes");
    }
  }
  return 0;
}
int main(int argc, char* argv[]) {
  ::std::ios::sync_with_stdio(false);
  ::std::cin.tie(0);
  ::std::cout.tie(0);
  int t = 1;
  while (t--) solve();
}
