#include <bits/stdc++.h>
using namespace std;
int n, m;
unsigned long long c[2507][2507], h[2507][2507];
inline int lowbit(int x) { return x & -x; }
void update(int x, int y, unsigned long long v) {
  while (x <= n) {
    int yy = y;
    while (yy <= m) {
      c[x][yy] += v;
      yy += lowbit(yy);
    }
    x += lowbit(x);
  }
}
unsigned long long query(int x, int y) {
  unsigned long long res = 0;
  while (x > 0) {
    int yy = y;
    while (yy > 0) {
      res += c[x][yy];
      yy -= lowbit(yy);
    }
    x -= lowbit(x);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  mt19937 rand(20171011);
  int q;
  cin >> n >> m >> q;
  while (q--) {
    int t, r1, c1, r2, c2;
    cin >> t >> r1 >> c1 >> r2 >> c2;
    if (t == 1) {
      unsigned long long v = (((unsigned long long)rand()) << 32) + rand();
      h[r1][c1] = v;
      update(r1, c1, v);
      update(r2 + 1, c1, -v);
      update(r1, c2 + 1, -v);
      update(r2 + 1, c2 + 1, v);
    } else if (t == 2) {
      unsigned long long v = h[r1][c1];
      update(r1, c1, -v);
      update(r2 + 1, c1, v);
      update(r1, c2 + 1, v);
      update(r2 + 1, c2 + 1, -v);
    } else {
      unsigned long long a = query(r1, c1);
      unsigned long long b = query(r2, c2);
      cout << (a == b ? "Yes" : "No") << '\n';
    }
  }
  return 0;
}
