#include <bits/stdc++.h>
using namespace std;
void assignStdin() {
  cin.sync_with_stdio(false);
  cin.tie(nullptr);
}
bool isDebug() { return false; }
const int MAXN = 2502;
int n, m, q, t, r1, c1, r2, c2;
long long hashTree[MAXN][MAXN] = {0};
template <typename T, size_t size_x, size_t size_y>
void updateXorAt(T (&tree)[size_x][size_y], int x, int y, T val) {
  for (int i = x; i <= n; i += i & -i) {
    for (int j = y; j <= m; j += j & -j) {
      tree[i][j] += val;
    }
  }
}
template <typename T, size_t size_x, size_t size_y>
T retrieveXorAt(T (&tree)[size_x][size_y], int x, int y) {
  T rs = 0;
  for (int i = x; i > 0; i -= i & -i) {
    for (int j = y; j > 0; j -= j & -j) {
      rs -= tree[i][j];
    }
  }
  return rs;
}
void updateTree() {
  long long hx = 1LL * r1 * c1 * (t == 1 ? 1 : -1);
  updateXorAt(hashTree, r1, c1, hx);
  updateXorAt(hashTree, r1, c2 + 1, -hx);
  updateXorAt(hashTree, r2 + 1, c1, -hx);
  updateXorAt(hashTree, r2 + 1, c2 + 1, hx);
}
bool isSameHash() {
  return retrieveXorAt(hashTree, r1, c1) == retrieveXorAt(hashTree, r2, c2);
}
int main(int argc, char *argv[]) {
  assignStdin();
  cin >> n >> m >> q;
  while (q-- > 0) {
    cin >> t >> r1 >> c1 >> r2 >> c2;
    if (t == 1 || t == 2) {
      updateTree();
      if (isDebug()) {
        for (int i = 1; i <= n; i++) {
          for (int j = 1; j <= m; j++) {
            cout << hashTree[i][j] << " ";
          }
          cout << endl;
        }
        cout << endl;
      }
    } else {
      cout << (isSameHash() ? "Yes" : "No") << endl;
    }
  }
}
