#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &V) {
  for (int i = 0; i < (int)V.size(); ++i) {
    if (i != 0) os << ' ';
    os << V[i];
  }
  return os;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &V) {
  for (int i = 0; i < (int)V.size(); ++i) {
    is >> V[i];
  }
  return is;
}
const int MAX_SIZE = 3000;
unsigned int f[MAX_SIZE][MAX_SIZE];
int query(int ry, int rx) {
  int res = 0;
  for (int i = ry; i >= 0; i = (i & (i + 1)) - 1)
    for (int j = rx; j >= 0; j = (j & (j + 1)) - 1) res += f[i][j];
  return res;
}
void modify(int ry, int rx, int val) {
  for (int i = ry; i < MAX_SIZE; i = (i | (i + 1)))
    for (int j = rx; j < MAX_SIZE; j = (j | (j + 1))) f[i][j] += val;
}
int get(int ry, int rx) { return query(ry, rx); }
void add(int ly, int lx, int ry, int rx, int val) {
  modify(ly, lx, val);
  modify(ry + 1, lx, -val);
  modify(ly, rx + 1, -val);
  modify(ry + 1, rx + 1, val);
}
struct KEK {
  int r1;
  int c1;
  int r2;
  int c2;
};
bool operator<(const KEK &lhs, const KEK &rhs) {
  if (lhs.r1 == rhs.r1) {
    if (lhs.c1 == rhs.c1) {
      if (lhs.r2 == rhs.r2) {
        return lhs.c2 < rhs.c2;
      }
      return lhs.r2 < rhs.r2;
    }
    return lhs.c1 < rhs.c1;
  }
  return lhs.r1 < rhs.r1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, m, q;
  cin >> n >> m >> q;
  map<KEK, int> M;
  while (q--) {
    int type;
    cin >> type;
    int r1, c1, r2, c2;
    cin >> r1 >> c1 >> r2 >> c2;
    if (type == 1) {
      unsigned int kek = rng();
      add(r1, c1, r2, c2, kek);
      KEK A = KEK{r1, c1, r2, c2};
      M[A] = kek;
    } else if (type == 2) {
      KEK A = KEK{r1, c1, r2, c2};
      unsigned int kek = M[A];
      add(r1, c1, r2, c2, -kek);
    } else {
      int num1 = get(r1, c1);
      int num2 = get(r2, c2);
      if (num1 == num2) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    }
  }
  return 0;
}
