#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
long long qkpow(int a, long long b) {
  if (b == 0) return 1;
  if (b == 1) return a;
  long long t = qkpow(a, b / 2);
  t = t * t % mod;
  if (b % 2 == 1) t = t * a % mod;
  return t;
}
int n, m, q, tot;
long long c[2510][2510];
inline void update(int x, int y, long long k) {
  for (register int i = x; i <= n; i += ((i) & -(i)))
    for (register int j = y; j <= m; j += ((j) & -(j))) c[i][j] += k;
}
inline long long query(int x, int y) {
  long long ret = 0;
  for (register int i = x; i; i -= ((i) & -(i)))
    for (register int j = y; j; j -= ((j) & -(j))) ret += c[i][j];
  return ret;
}
inline void init() { scanf("%d%d%d", &n, &m, &q); }
inline void work() {
  int opt, x1, y1, x2, y2;
  while (q--) {
    scanf("%d%d%d%d%d", &opt, &x1, &y1, &x2, &y2);
    if (opt == 1) {
      long long num =
          (qkpow(2, x1) + qkpow(2, y1) + qkpow(2, n + x2) + qkpow(2, n + y2)) %
          mod;
      update(x1, y1, num);
      update(x1, y2 + 1, -num);
      update(x2 + 1, y1, -num);
      update(x2 + 1, y2 + 1, num);
    } else if (opt == 2) {
      long long num =
          (qkpow(2, x1) + qkpow(2, y1) + qkpow(2, n + x2) + qkpow(2, n + y2)) %
          mod;
      update(x1, y1, -num);
      update(x1, y2 + 1, num);
      update(x2 + 1, y1, num);
      update(x2 + 1, y2 + 1, -num);
    } else {
      if (query(x1, y1) == query(x2, y2))
        puts("Yes");
      else
        puts("No");
    }
  }
}
int main() {
  init();
  work();
  return 0;
}
