#include <bits/stdc++.h>
using namespace std;
const int MAXN = 2500 + 10;
long long tree[MAXN][MAXN];
long long seed = 2333;
int n, m, q;
int lowbit(int x) { return x & (-x); }
void update(int x, int y, long long val) {
  for (int i = x; i <= n; i += lowbit(i)) {
    for (int j = y; j <= m; j += lowbit(j)) {
      tree[i][j] += val;
    }
  }
}
void update(int r1, int c1, int r2, int c2, long long val) {
  update(r1, c1, val);
  update(r1, c2 + 1, -val);
  update(r2 + 1, c1, -val);
  update(r2 + 1, c2 + 1, val);
}
long long query(int x, int y) {
  long long ans = 0;
  for (int i = x; i >= 1; i -= lowbit(i)) {
    for (int j = y; j >= 1; j -= lowbit(j)) {
      ans += tree[i][j];
    }
  }
  return ans;
}
int main(void) {
  ios::sync_with_stdio(false);
  cin >> n >> m >> q;
  memset(tree, 0x00, sizeof(tree));
  while (q--) {
    int t, r1, c1, r2, c2;
    cin >> t >> r1 >> c1 >> r2 >> c2;
    long long val = r1;
    val = val * seed + c1;
    val = val * seed + r2;
    val = val * seed + c2;
    switch (t) {
      case 1: {
        update(r1, c1, r2, c2, val);
        break;
      }
      case 2: {
        update(r1, c1, r2, c2, -val);
        break;
      }
      case 3: {
        long long a1 = query(r1, c1);
        long long a2 = query(r2, c2);
        if (a1 == a2)
          cout << "Yes\n";
        else
          cout << "No\n";
        break;
      }
    }
  }
  return 0;
}
