#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
typedef struct Rect {
  int r1, c1, r2, c2;
  bool operator<(const Rect &rhs) const {
    if (r1 < rhs.r1) return true;
    if (r1 > rhs.r1) return false;
    if (c1 < rhs.c1) return true;
    if (c1 > rhs.c1) return false;
    if (r2 < rhs.r2) return true;
    if (r2 > rhs.r2) return false;
    if (c2 < rhs.c2) return true;
    if (c2 > rhs.c2) return false;
    return false;
  }
} rect;
void print_rects(set<rect> rects) {
  cout << "* * * *" << endl;
  set<rect>::iterator iter;
  for (iter = rects.begin(); iter != rects.end(); iter++) {
    printf("%d %d %d %d\n", iter->r1, iter->c1, iter->r2, iter->c2);
  }
  cout << "* * * *" << endl;
};
void sort_rect(rect r) {
  if (r.r1 > r.r2) {
    int temp = r.r1;
    r.r1 = r.r2;
    r.r2 = temp;
  }
  if (r.c1 > r.c2) {
    int temp = r.c1;
    r.c1 = r.c2;
    r.c2 = temp;
  }
}
bool in_out(rect r, int x, int y) {
  if (r.r1 <= x && x <= r.r2 && r.c1 <= y && y <= r.c2)
    return true;
  else
    return false;
}
int main() {
  set<rect> rects;
  set<rect>::iterator iter;
  int N = 0, M = 0, A = 0;
  scanf("%d %d %d", &N, &M, &A);
  int action = 0, r1 = 0, r2 = 0, c1 = 0, c2 = 0;
  for (int q = 1; q <= A; q++) {
    scanf("%d %d %d %d %d", &action, &r1, &c1, &r2, &c2);
    rect r = {r1, c1, r2, c2};
    switch (action) {
      case 1:
        sort_rect(r);
        rects.insert(r);
        break;
      case 2:
        sort_rect(r);
        rects.erase(rects.find(r));
        break;
      case 3:
        set<rect>::iterator iter;
        for (iter = rects.begin(); iter != rects.end(); iter++)
          if (in_out(*iter, r1, c1) ^ in_out(*iter, r2, c2)) goto No;
        printf("Yes\n");
        break;
      No:
        printf("No\n");
        break;
    }
  }
  return 0;
}
