#include <bits/stdc++.h>
using namespace std;
const int N = 2505;
const int P = 31;
const int mod = 1e9 + 7;
int n, m;
int bit[N][N];
void add(int x, int y, int v) {
  while (x <= n) {
    int j = y;
    while (j <= m) {
      bit[x][j] += v;
      j += (j & (-j));
    }
    x += (x & (-x));
  }
}
int sum(int x, int y) {
  int ans = 0;
  while (x) {
    int j = y;
    while (j) {
      ans += bit[x][j];
      j -= (j & (-j));
    }
    x -= (x & (-x));
  }
  return ans;
}
void solve(int x1, int y1, int x2, int y2, int v) {
  add(x1, y1, v);
  add(x1, y2 + 1, -v);
  add(x2 + 1, y1, -v);
  add(x2 + 1, y2 + 1, v);
}
int main() {
  int q, a, b, t, r1, c1, r2, c2, aim, cnt = 1;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d%d%d%d", &t, &r1, &c1, &r2, &c2);
    if (t == 1) {
      t = sum(r1, c1);
      t = cnt - t;
      solve(r1, c1, r2, c2, t);
      cnt = (long long)cnt * P % mod;
    } else if (t == 2) {
      t = sum(r1 - 1, c1);
      t = t - sum(r1, c1);
      solve(r1, c1, r2, c2, t);
    } else {
      a = sum(r1, c1), b = sum(r2, c2);
      if (a == b)
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
