#include <bits/stdc++.h>
using namespace std;
struct str {
  int x;
  long long y;
};
map<pair<pair<int, int>, pair<int, int> >, int> q1;
str aib[2510][2510];
int n, m;
void aib_update(int r, int c, int val, int semn) {
  for (int i = r; i <= n; i += i & (-i))
    for (int j = c; j <= m; j += j & (-j)) {
      aib[i][j].x += val * semn;
      aib[i][j].y += 1LL * val * val * semn;
    }
}
pair<long long, long long> aib_query(int r, int c) {
  pair<long long, long long> rez;
  rez = {0, 0};
  for (int i = r; i > 0; i -= i & (-i))
    for (int j = c; j > 0; j -= j & (-j)) {
      rez.first += aib[i][j].x;
      rez.second += aib[i][j].y;
    }
  return rez;
}
int main() {
  int q, y, r1, c1, r2, c2, t;
  scanf("%d%d%d", &n, &m, &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d%d%d%d", &t, &r1, &c1, &r2, &c2);
    if (t == 1) {
      q1[{{r1, c1}, {r2, c2}}] = i;
      aib_update(r1, c1, i, 1);
      aib_update(r2 + 1, c2 + 1, i, 1);
      aib_update(r2 + 1, c1, i, -1);
      aib_update(r1, c2 + 1, i, -1);
    } else if (t == 2) {
      int c = q1[{{r1, c1}, {r2, c2}}];
      aib_update(r1, c1, c, -1);
      aib_update(r2 + 1, c2 + 1, c, -1);
      aib_update(r2 + 1, c1, c, 1);
      aib_update(r1, c2 + 1, c, 1);
    } else {
      if (aib_query(r1, c1) == aib_query(r2, c2))
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
