#include <bits/stdc++.h>
using namespace std;
const int N = 2502;
int r, c, q, cc;
pair<long long, long long> BIT[N][N];
long long bases[2], mods[2], powers[2][N];
map<pair<pair<long long, long long>, pair<long long, long long> >, int>
    compress, present;
void update(int idx1, int idx2, pair<long long, long long> val) {
  while (idx1 < N) {
    int y = idx2;
    while (y < N) {
      BIT[idx1][y].first = (BIT[idx1][y].first + val.first) % mods[0];
      BIT[idx1][y].second = (BIT[idx1][y].second + val.second) % mods[1];
      y += y & (-y);
    }
    idx1 += idx1 & (-idx1);
  }
}
pair<long long, long long> query(int idx1, int idx2) {
  pair<long long, long long> ans(0, 0);
  while (idx1) {
    int y = idx2;
    while (y) {
      ans.first = (BIT[idx1][y].first + ans.first) % mods[0];
      ans.second = (BIT[idx1][y].second + ans.second) % mods[1];
      y -= y & (-y);
    }
    idx1 -= idx1 & (-idx1);
  }
  ans.first %= mods[0];
  ans.first += mods[0];
  ans.first %= mods[0];
  ans.second %= mods[1];
  ans.second += mods[1];
  ans.second %= mods[1];
  return ans;
}
int main() {
  bases[0] = 31;
  bases[1] = 37;
  mods[0] = 1000000007;
  mods[1] = 1000000009;
  powers[0][0] = powers[1][0] = 1;
  for (int i = 1; i < N; i++) {
    powers[0][i] = (powers[0][i - 1] * bases[0]) % mods[0];
    powers[1][i] = (powers[1][i - 1] * bases[1]) % mods[1];
  }
  scanf("%d%d%d", &r, &c, &q);
  cc = 0;
  while (q--) {
    int op, x1, y1, x2, y2;
    scanf("%d%d%d%d%d", &op, &x1, &y1, &x2, &y2);
    if (op == 1) {
      if (compress[pair<pair<long long, long long>,
                        pair<long long, long long> >(
              pair<long long, long long>(x1, y1),
              pair<long long, long long>(x2, y2))] == 0)
        compress[pair<pair<long long, long long>, pair<long long, long long> >(
            pair<long long, long long>(x1, y1),
            pair<long long, long long>(x2, y2))] = ++cc;
      int z = compress[pair<pair<long long, long long>,
                            pair<long long, long long> >(
          pair<long long, long long>(x1, y1),
          pair<long long, long long>(x2, y2))];
      pair<long long, long long> hashval1(powers[0][z], powers[1][z]),
          hashval2(-powers[0][z], -powers[1][z]);
      update(x1, y1, hashval1);
      update(x1, y2 + 1, hashval2);
      update(x2 + 1, y1, hashval2);
      update(x2 + 1, y2 + 1, hashval1);
    } else if (op == 2) {
      if (compress[pair<pair<long long, long long>,
                        pair<long long, long long> >(
              pair<long long, long long>(x1, y1),
              pair<long long, long long>(x2, y2))] == 0)
        compress[pair<pair<long long, long long>, pair<long long, long long> >(
            pair<long long, long long>(x1, y1),
            pair<long long, long long>(x2, y2))] = ++cc;
      int z = compress[pair<pair<long long, long long>,
                            pair<long long, long long> >(
          pair<long long, long long>(x1, y1),
          pair<long long, long long>(x2, y2))];
      pair<long long, long long> hashval1(powers[0][z], powers[1][z]),
          hashval2(-powers[0][z], -powers[1][z]);
      update(x1, y1, hashval2);
      update(x1, y2 + 1, hashval1);
      update(x2 + 1, y1, hashval1);
      update(x2 + 1, y2 + 1, hashval2);
    } else if (op == 3) {
      if (query(x1, y1) == query(x2, y2))
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
