#include <bits/stdc++.h>
using namespace std;
const int N = 2505;
int n, m;
int q;
struct fenwick_2D {
  int val[N][N];
  void update(int x, int y, int d) {
    int i, j;
    for (i = x; i <= n; i += (i & (-i)))
      for (j = y; j <= m; j += (j & (-j))) val[i][j] ^= d;
  }
  int query(int x, int y) {
    int i, j;
    int res = 0;
    for (i = x; i > 0; i -= (i & (-i)))
      for (j = y; j > 0; j -= (j & (-j))) res ^= val[i][j];
    return res;
  }
} fen;
map<vector<int>, unsigned int> mp;
int main() {
  srand(20010711);
  int i;
  int t, r1, r2, c1, c2;
  unsigned int h;
  cin >> n >> m >> q;
  while (q--) {
    scanf("%d%d%d%d%d", &t, &r1, &c1, &r2, &c2);
    if (t == 1 || t == 2) {
      if (mp[{r1, c1, r2, c2}] == 0) {
        mp[{r1, c1, r2, c2}] = rand() * rand() + rand();
      }
      h = mp[{r1, c1, r2, c2}];
      fen.update(r1, c1, h);
      fen.update(r2 + 1, c1, h);
      fen.update(r1, c2 + 1, h);
      fen.update(r2 + 1, c2 + 1, h);
    }
    if (t == 3) {
      if (fen.query(r1, c1) == fen.query(r2, c2))
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
