#include <bits/stdc++.h>
using namespace std;
int was[2505][2505];
int read() {
  int s = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') {
    s = s * 10 + c - '0';
    c = getchar();
  }
  return s;
}
int main() {
  int n = read(), m = read(), q = read();
  for (int i = 1; i <= q; i++) {
    int t = read(), r1 = read(), c1 = read(), r2 = read(), c2 = read();
    if (t == 1)
      for (int r = r1; r <= r2; r++) {
        was[r][c1] = i;
        was[r][c2 + 1] = -1;
      }
    else if (t == 2)
      for (int r = r1; r <= r2; r++) was[r][c1] = was[r][c2 + 1] = 0;
    else {
      int st = 0, res1 = 0, res2 = 0;
      for (int i = c1; i >= 0; i--)
        if (was[r1][i] > 0)
          if (st == 0) {
            res1 = was[r1][i];
            break;
          } else
            st++;
        else if (was[r1][i] < 0)
          st--;
      st = 0;
      for (int i = c2; i >= 0; i--)
        if (was[r2][i] > 0)
          if (st == 0) {
            res2 = was[r2][i];
            break;
          } else
            st++;
        else if (was[r2][i] < 0)
          st--;
      printf("%s", res1 == res2 ? "Yes\n" : "No\n");
    }
  }
  return 0;
}
