#include <bits/stdc++.h>
using namespace std;
using VS = vector<string>;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
using VL = vector<LL>;
using VVL = vector<VL>;
const int INF = 1e9;
const LL LINF = 1e16;
const LL MOD = 1000000007;
const double PI = acos(-1.0);
int DX[8] = {0, 0, 1, -1, 1, 1, -1, -1};
int DY[8] = {1, -1, 0, 0, 1, -1, 1, -1};
template <typename T>
struct BIT2D {
  int H, W;
  vector<vector<T>> data;
  BIT2D(int h, int w) {
    H = h;
    W = w;
    int MAX = max(H, W);
    data = vector<vector<T>>(MAX + 1, vector<T>(MAX + 1, 0));
  }
  void add(int a, int b, T val) {
    for (int x = a; x <= W; x += x & -x) {
      for (int y = b; y <= H; y += y & -y) {
        data[x][y] += val;
      }
    }
  }
  T _sum(int a, int b) {
    T ret = 0;
    for (int x = a; x > 0; x -= x & -x) {
      for (int y = b; y > 0; y -= y & -y) {
        ret += data[x][y];
      }
    }
    return ret;
  }
  T sum(int lx, int ly, int rx, int ry) {
    return _sum(rx, ry) - _sum(lx - 1, ry) - _sum(rx, ly - 1) +
           _sum(lx - 1, ly - 1);
  }
};
LL N, M, Q;
LL ans = 0LL;
map<pair<PII, PII>, LL> memo;
long long myrand() { return abs(rand() * rand() + 2311 * rand() + 1992); }
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cin >> N >> M >> Q;
  BIT2D<LL> bit(2600, 2600);
  srand(time(NULL));
  for (int(i) = (0); (i) < (Q); (i)++) {
    int t;
    cin >> t;
    int y1, x1, y2, x2;
    cin >> y1 >> x1 >> y2 >> x2;
    if (t == 1) {
      LL rn = myrand() * myrand();
      memo[make_pair(PII(y1, x1), PII(y2, x2))] = rn;
      bit.add(y1, x1, rn);
      bit.add(y1, x2 + 1, -rn);
      bit.add(y2 + 1, x1, -rn);
      bit.add(y2 + 1, x2 + 1, rn);
    } else if (t == 2) {
      LL rn = memo[make_pair(PII(y1, x1), PII(y2, x2))];
      bit.add(y1, x1, -rn);
      bit.add(y1, x2 + 1, rn);
      bit.add(y2 + 1, x1, rn);
      bit.add(y2 + 1, x2 + 1, -rn);
    } else {
      if (bit._sum(y1, x1) == bit._sum(y2, x2)) {
        cout << "Yes" << endl;
      } else {
        cout << "No" << endl;
      }
    }
  }
  return 0;
}
