#include <bits/stdc++.h>
using namespace std;
template <typename T, typename U>
inline void smin(T &a, U b) {
  if (a > b) a = b;
}
template <typename T, typename U>
inline void smax(T &a, U b) {
  if (a < b) a = b;
}
template <class T>
inline void gn(T &first) {
  char c, sg = 0;
  while (c = getchar(), (c > '9' || c < '0') && c != '-')
    ;
  for ((c == '-' ? sg = 1, c = getchar() : 0), first = 0; c >= '0' && c <= '9';
       c = getchar())
    first = (first << 1) + (first << 3) + c - '0';
  if (sg) first = -first;
}
template <class T>
inline void print(T first) {
  if (first < 0) {
    putchar('-');
    return print(-first);
  }
  if (first < 10) {
    putchar('0' + first);
    return;
  }
  print(first / 10);
  putchar(first % 10 + '0');
}
int power(int a, int b, int m, int ans = 1) {
  for (; b; b >>= 1, a = 1LL * a * a % m)
    if (b & 1) ans = 1LL * ans * a % m;
  return ans;
}
int B[3333][3333];
long long C[3333][3333];
int id[3333][3333];
int n, m;
void update(int r, int c, int d, int p) {
  while (r <= n) {
    int cc = c;
    while (cc <= m) {
      B[r][cc] += d;
      C[r][cc] += p;
      cc += cc & -cc;
    }
    r += r & -r;
  }
}
int calc1(int u, int v) {
  int ans = 0;
  while (u) {
    int vv = v;
    while (vv) {
      ans += B[u][vv];
      vv -= vv & -vv;
    }
    u -= u & -u;
  }
  return ans;
}
long long calc2(int u, int v) {
  long long ans = 0;
  int vv = v;
  while (u) {
    v = vv;
    while (v) {
      ans += C[u][v];
      v -= v & -v;
    }
    u -= u & -u;
  }
  return ans;
}
int main() {
  int q;
  cin >> n >> m >> q;
  int t, r1, c1, r2, c2;
  memset(id, -1, sizeof id);
  for (int i = 1; i <= q; i++) {
    scanf("%d %d %d %d %d", &t, &r1, &c1, &r2, &c2);
    long long p = (long long)i * i;
    if (t == 1) {
      update(r1, c1, 1, p);
      update(r2 + 1, c1, -1, -p);
      update(r1, c2 + 1, -1, -p);
      update(r2 + 1, c2 + 1, 1, p);
      id[r1][c1] = i;
    }
    if (t == 2) {
      p = (long long)id[r1][c1] * id[r1][c1];
      update(r1, c1, -1, -p);
      update(r2 + 1, c1, 1, p);
      update(r1, c2 + 1, 1, p);
      update(r2 + 1, c2 + 1, -1, -p);
    }
    if (t == 3) {
      long long a = calc1(r1, c1), b = calc1(r2, c2);
      if (a != b) {
        puts("No");
        continue;
      }
      a = calc2(r1, c1), b = calc2(r2, c2);
      if (a != b) {
        puts("No");
        continue;
      }
      puts("Yes");
    }
  }
  return 0;
}
