#include <bits/stdc++.h>
using namespace std;
inline void read(int &x) {
  char c = getchar();
  int p = 1;
  x = 0;
  while (!isdigit(c)) {
    if (c == '-') p = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ '0');
    c = getchar();
  }
  x *= p;
}
const int maxn = 2550;
int n, m, q;
struct BIT {
  unsigned long long sum[maxn][maxn];
  inline int lowbit(int x) { return x & (-x); }
  inline void update(int u, int x, int num) {
    while (x <= m) {
      sum[u][x] ^= num;
      x += lowbit(x);
    }
  }
  inline void Update(int x, int y, int num) {
    while (x <= n) {
      update(x, y, num);
      x += lowbit(x);
    }
  }
  inline int query(int u, int x) {
    int ret = 0;
    while (x) {
      ret ^= sum[u][x];
      x -= lowbit(x);
    }
    return ret;
  }
  inline int Query(int x, int y) {
    int ret = 0;
    while (x) {
      ret ^= query(x, y);
      x -= lowbit(x);
    }
    return ret;
  }
} bit;
int main() {
  srand(19260817);
  read(n), read(m), read(q);
  unsigned long long a = 1ull * rand() * rand(), b = 1ull * rand() * rand(),
                     c = 1ull * rand() * rand(), d = 1ull * rand() * rand();
  int opt, xx1, xx2, yy1, yy2;
  while (q--) {
    read(opt), read(xx1), read(yy1), read(xx2), read(yy2);
    if (opt == 1 || opt == 2) {
      unsigned long long delta =
          1ull * a * xx1 + 1ull * b * yy1 + 1ull * c * xx2 + 1ull * d * yy2;
      bit.Update(xx1, yy1, delta);
      bit.Update(xx2 + 1, yy1, delta);
      bit.Update(xx1, yy2 + 1, delta);
      bit.Update(xx2 + 1, yy2 + 1, delta);
    } else {
      unsigned long long ret1 = 0, ret2 = 0;
      ret1 = bit.Query(xx1, yy1);
      ret2 = bit.Query(xx2, yy2);
      if (ret1 == ret2)
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
