#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 2505;
long long rd() { return rand() << 15 | rand(); }
int n, m, q;
long long bit[N][N];
map<pair<pair<int, int>, pair<int, int> >, int> mp;
void add(int r, int c, int x) {
  for (int i = r; i; i -= i & -i)
    for (int j = c; j; j -= j & -j) bit[i][j] += x;
}
long long Sum(int r, int c) {
  long long ans = 0;
  for (int i = r; i < N; i += i & -i)
    for (int j = c; j < N; j += j & -j) ans += bit[i][j];
  return ans;
}
int main() {
  srand(time(0));
  for (int i = 1; i <= 50; ++i) srand(rd());
  scanf("%d%d%d", &n, &m, &q);
  int t, r1, c1, r2, c2;
  for (int i = 1; i <= q; ++i) {
    scanf("%d%d%d%d%d", &t, &r1, &c1, &r2, &c2);
    if (t == 1) {
      int rdm = rd();
      add(r2, c2, rdm);
      add(r1 - 1, c1 - 1, rdm);
      add(r1 - 1, c2, -rdm);
      add(r2, c1 - 1, -rdm);
      mp[make_pair(make_pair(r1, c1), make_pair(r2, c2))] = rdm;
    } else if (t == 2) {
      int tmp = mp[make_pair(make_pair(r1, c1), make_pair(r2, c2))];
      add(r2, c2, -tmp);
      add(r1 - 1, c1 - 1, -tmp);
      add(r1 - 1, c2, tmp);
      add(r2, c1 - 1, tmp);
    } else {
      long long ans1 = Sum(r1, c1), ans2 = Sum(r2, c2);
      if (ans1 == ans2)
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
