#include <bits/stdc++.h>
using namespace std;
int n, m, q;
long long fen[2505][2505];
long long A[2505][2505];
long long rl() {
  long long ret = 0ll;
  ret ^= rand();
  ret <<= 15;
  ret ^= rand();
  ret <<= 15;
  ret ^= rand();
  if (ret == 0ll) ret++;
  return ret;
}
void add(int x, int y, long long val) {
  int idx1 = x, idx2 = y;
  while (idx1 <= n) {
    idx2 = y;
    while (idx2 <= m) {
      fen[idx1][idx2] += val;
      idx2 += (idx2 & (-idx2));
    }
    idx1 += (idx1 & (-idx1));
  }
}
long long sum(int x, int y) {
  if (x == 0 || y == 0) return 0ll;
  int idx1 = x, idx2 = y;
  long long ret = 0;
  while (idx1 >= 1) {
    idx2 = y;
    while (idx2 >= 1) {
      ret += fen[idx1][idx2];
      idx2 -= (idx2 & (-idx2));
    }
    idx1 -= (idx1 & (-idx1));
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q;
  while (q--) {
    int type, t1, t2, t3, t4;
    cin >> type >> t1 >> t2 >> t3 >> t4;
    if (type == 1) {
      long long r = rl();
      add(t1, t2, r);
      add(t1, t4 + 1, -r);
      add(t3 + 1, t2, -r);
      add(t3 + 1, t4 + 1, r);
      A[t1][t2] = A[t3 + 1][t4 + 1] = r;
      A[t1][t4 + 1] = A[t3 + 1][t2] = -r;
    } else if (type == 2) {
      add(t1, t2, -A[t1][t2]);
      add(t1, t4 + 1, -A[t1][t4 + 1]);
      add(t3 + 1, t2, -A[t3 + 1][t2]);
      add(t3 + 1, t4 + 1, -A[t3 + 1][t4 + 1]);
      A[t1][t2] = A[t1][t4 + 1] = A[t3 + 1][t2] = A[t3 + 1][t4 + 1] = 0;
    } else {
      if (sum(t1, t2) == sum(t3, t4)) {
        cout << "Yes\n";
      } else
        cout << "No\n";
    }
  }
  return 0;
}
