#include <bits/stdc++.h>
using namespace std;
const int N = 2502;
int n, m, q;
long long tree[N][N];
map<pair<pair<int, int>, pair<int, int> >, long long> comp;
void update(int i, int j, long long d) {
  ++i, ++j;
  while (i < N) {
    int jj = j;
    while (jj < N) tree[i][jj] += d, jj += jj & -jj;
    i += i & -i;
  }
}
long long query(int i, int j) {
  ++i, ++j;
  long long sum = 0;
  while (i > 0) {
    int jj = j;
    while (jj > 0) sum += tree[i][jj], jj -= jj & -jj;
    i -= i & -i;
  }
  return sum;
}
int main() {
  srand(time(NULL));
  scanf("%d%d%d", &n, &m, &q);
  while (q--) {
    int t, x1, y1, x2, y2;
    scanf("%d", &t);
    scanf("%d%d", &x1, &y1);
    scanf("%d%d", &x2, &y2);
    pair<pair<int, int>, pair<int, int> > x =
        make_pair(make_pair(x1, y1), make_pair(x2, y2));
    if (t == 1) {
      comp[x] = (rand() << 10) + rand();
      update(x1, y1, comp[x]);
      update(x2 + 1, y1, -comp[x]);
      update(x1, y2 + 1, -comp[x]);
      update(x2 + 1, y2 + 1, comp[x]);
    } else if (t == 2) {
      update(x1, y1, -comp[x]);
      update(x2 + 1, y1, comp[x]);
      update(x1, y2 + 1, comp[x]);
      update(x2 + 1, y2 + 1, -comp[x]);
    } else
      printf("%s\n", query(x1, y1) == query(x2, y2) ? "Yes" : "No");
  }
}
