#include <bits/stdc++.h>
template <class T>
inline T read(const T sample) {
  T x = 0;
  int f = 1;
  char s;
  while ((s = getchar()) > '9' || s < '0')
    if (s == '-') f = -1;
  while (s >= '0' && s <= '9')
    x = (x << 1) + (x << 3) + (s ^ 48), s = getchar();
  return x * f;
}
template <class T>
inline void write(const T x) {
  if (x < 0) return (void)(putchar('-'), write(-x));
  if (x > 9) write(x / 10);
  putchar(x % 10 ^ 48);
}
template <class T>
inline T Max(const T x, const T y) {
  return x > y ? x : y;
}
template <class T>
inline T Min(const T x, const T y) {
  return x < y ? x : y;
}
template <class T>
inline T fab(const T x) {
  return x > 0 ? x : -x;
}
template <class T>
inline T Gcd(const T x, const T y) {
  return y ? Gcd(y, x % y) : x;
}
using namespace std;
const int N = 2505, Base = 10037;
int n, m;
long long num = 1, tmp, t[N][N];
map<pair<pair<int, int>, pair<int, int> >, long long> ma;
int lowbit(int x) { return x & -x; }
void add(int x, int y, long long k) {
  for (int i = x; i <= n; i += lowbit(i))
    for (int j = y; j <= m; j += lowbit(j)) t[i][j] += k;
}
long long ask(int x, int y) {
  long long r = 0;
  for (int i = x; i; i -= lowbit(i))
    for (int j = y; j; j -= lowbit(j)) r += t[i][j];
  return r;
}
int main() {
  int op, a, b, c, d;
  n = read(9), m = read(9);
  for (int t = read(9); t; --t) {
    op = read(9), a = read(9), b = read(9), c = read(9), d = read(9);
    if (op == 1) {
      num *= Base;
      ma[make_pair(make_pair(a, b), make_pair(c, d))] = num;
      add(a, b, num), add(c + 1, d + 1, num);
      add(a, d + 1, -num), add(c + 1, b, -num);
    } else if (op == 2) {
      tmp = ma[make_pair(make_pair(a, b), make_pair(c, d))];
      add(a, b, -tmp), add(c + 1, d + 1, -tmp);
      add(a, d + 1, tmp), add(c + 1, b, tmp);
    } else {
      if (ask(a, b) == ask(c, d))
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
