#include <bits/stdc++.h>
using namespace std;
long long tree[3030][3030];
int n, m;
map<pair<pair<int, int>, pair<int, int> >, long long> mp;
long long rd() {
  long long tmp = 0;
  tmp += rand();
  tmp = tmp << 15;
  tmp += rand();
  tmp = tmp << 15;
  tmp += rand();
  tmp = tmp << 15;
  tmp += rand();
  return tmp;
}
int lowbit(int x) { return x & -x; }
void update(int x, int y, long long w) {
  for (int i = x; i <= n; i += lowbit(i))
    for (int j = y; j <= m; j += lowbit(j)) tree[i][j] ^= w;
}
long long query(int x, int y) {
  long long ans = 0;
  for (int i = x; i > 0; i -= lowbit(i))
    for (int j = y; j > 0; j -= lowbit(j)) ans ^= tree[i][j];
  return ans;
}
int main() {
  int q, i, ca, x, y, xx, yy;
  long long tmp1, tmp2, p;
  srand(1234678);
  scanf("%d%d%d", &n, &m, &q);
  for (i = 1; i <= q; i++) {
    scanf("%d%d%d%d%d", &ca, &x, &y, &xx, &yy);
    if (ca == 3) {
      tmp1 = query(x, y);
      tmp2 = query(xx, yy);
      if (tmp1 == tmp2)
        puts("Yes");
      else
        puts("No");
    } else {
      if (ca == 1)
        p = rd(), mp[make_pair(make_pair(x, y), make_pair(xx, yy))] = p;
      else
        p = mp[make_pair(make_pair(x, y), make_pair(xx, yy))];
      update(x, y, p);
      update(xx + 1, y, p);
      update(x, yy + 1, p);
      update(xx + 1, yy + 1, p);
    }
  }
  return 0;
}
