#include <bits/stdc++.h>
using namespace std;
const int MAX = 2501, Q = 1e5 + 1;
const long long MOD = 1e9 + 7;
long long modPow(long long b, long long e) {
  if (!e)
    return 1;
  else if (e == 1)
    return b;
  else
    return modPow(b * b % MOD, e >> 1) * modPow(b, e & 1) % MOD;
}
int n, m, q;
long long vf[Q], vg[Q], f[MAX][MAX], g[MAX][MAX];
map<tuple<int, int, int, int>, int> mp;
void update(int x, int y, long long vf, long long vg) {
  for (int i = x; i <= n; i += i & -i)
    for (int j = y; j <= m; j += j & -j) {
      f[i][j] = (f[i][j] + vf) % MOD;
      g[i][j] = (g[i][j] + vg) % MOD;
    }
}
pair<long long, long long> query(int x, int y) {
  long long retf = 0, retg = 0;
  for (int i = x; i > 0; i -= i & -i)
    for (int j = y; j > 0; j -= j & -j) {
      retf = (retf + f[i][j]) % MOD;
      retg = (retg + g[i][j]) % MOD;
    }
  retf = (retf + MOD) % MOD;
  retg = (retg + MOD) % MOD;
  return {retf, retg};
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> q;
  for (int i = 0, tp, r1, c1, r2, c2; i < q; i++) {
    cin >> tp >> r1 >> c1 >> r2 >> c2;
    if (tp == 1) {
      vf[i] = modPow(13, i), vg[i] = modPow(17, i);
      update(r1, c1, vf[i], vg[i]);
      update(r1, c2 + 1, -vf[i], -vg[i]);
      update(r2 + 1, c1, -vf[i], -vg[i]);
      update(r2 + 1, c2 + 1, vf[i], vg[i]);
      mp[make_tuple(r1, c1, r2, c2)] = i;
    } else if (tp == 2) {
      int idx = mp[make_tuple(r1, c1, r2, c2)];
      update(r1, c1, -vf[idx], -vg[idx]);
      update(r1, c2 + 1, vf[idx], vg[idx]);
      update(r2 + 1, c1, vf[idx], vg[idx]);
      update(r2 + 1, c2 + 1, -vf[idx], -vg[idx]);
    } else {
      if (query(r1, c1) == query(r2, c2))
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
}
