#include <bits/stdc++.h>
using namespace std;
const int SEED = chrono::steady_clock::now().time_since_epoch().count();
mt19937_64 rng(SEED);
const int MAX = 2505;
long long int tree[MAX][MAX];
void bit_update(int x, int y, long long int v) {
  while (x < MAX) {
    int y0 = y;
    while (y0 < MAX) {
      tree[x][y0] ^= v;
      y0 += y0 & (-y0);
    }
    x += x & (-x);
  }
}
long long int bit_query(int x, int y) {
  long long int res = 0;
  while (x) {
    int y0 = y;
    while (y0) {
      res ^= tree[x][y0];
      y0 -= y0 & (-y0);
    }
    x -= x & (-x);
  }
  return res;
}
void update(int x0, int y0, int x1, int y1, long long int v) {
  bit_update(x0, y0, v);
  bit_update(x0, y1, v);
  bit_update(x1, y0, v);
  bit_update(x1, y1, v);
}
void test_case() {
  int n, m, q, t, r1, c1, r2, c2;
  cin >> n >> m >> q;
  map<tuple<int, int, int, int>, long long int> mp;
  while (q--) {
    cin >> t >> r1 >> c1 >> r2 >> c2;
    if (t == 1) mp[{r1, c1, r2, c2}] = rng();
    if (t != 3)
      update(r1, c1, r2 + 1, c2 + 1, mp[{r1, c1, r2, c2}]);
    else {
      if (bit_query(r1, c1) == bit_query(r2, c2))
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t = 1;
  for (int i = 1; i <= t; i++) {
    test_case();
  }
  return 0;
}
