#include <bits/stdc++.h>
using namespace std;
const int maxn = 2500 + 10, inf = 0x3f3f3f3f;
pair<unsigned long long, unsigned long long> bit[maxn][maxn];
int n;
inline int lowbit(int x) { return x & (-x); }
pair<unsigned long long, unsigned long long> sum(int x, int y) {
  pair<unsigned long long, unsigned long long> s =
      pair<unsigned long long, unsigned long long>((unsigned long long)0,
                                                   (unsigned long long)0);
  for (int i = x; i > 0; i -= lowbit(i))
    for (int j = y; j > 0; j -= lowbit(j)) {
      s.first += bit[i][j].first;
      s.second += bit[i][j].second;
    }
  return s;
}
void add(int x, int y, pair<unsigned long long, unsigned long long> v) {
  for (int i = x; i <= maxn; i += lowbit(i))
    for (int j = y; j <= maxn; j += lowbit(j)) {
      bit[i][j].first += v.first;
      bit[i][j].second += v.second;
    }
}
void update(int x1, int y1, int x2, int y2,
            pair<unsigned long long, unsigned long long> v) {
  add(x1, y1, v);
  add(x2 + 1, y2 + 1, v);
  v.first = -v.first;
  v.second = -v.second;
  add(x1, y2 + 1, v);
  add(x2 + 1, y1, v);
}
int m, q, t, a, b, c, d;
pair<unsigned long long, unsigned long long> v;
map<pair<pair<int, int>, pair<int, int> >,
    pair<unsigned long long, unsigned long long> >
    mp;
int main() {
  srand(20001206);
  scanf("%d%d%d", &n, &m, &q);
  while (q--) {
    scanf("%d%d%d%d%d", &t, &a, &b, &c, &d);
    if (t == 1) {
      v.first = (unsigned long long)rand() * rand() * rand();
      v.second = (unsigned long long)rand() * rand() * rand();
      mp[make_pair(pair<int, int>(a, b), pair<int, int>(c, d))] = v;
      update(a, b, c, d, v);
    } else if (t == 2) {
      v = mp[make_pair(pair<int, int>(a, b), pair<int, int>(c, d))];
      v.first = -v.first;
      v.second = -v.second;
      update(a, b, c, d, v);
    } else {
      if (sum(a, b) == sum(c, d))
        puts("Yes");
      else
        puts("No");
    }
  }
  return 0;
}
