#include <bits/stdc++.h>
using namespace std;
using cd = complex<double>;
const int N = 3e3 + 5;
const long long INF = 1e18;
const int mod = 1e9 + 7;
const double Pi = acos(-1);
const int p = 510200;
void Fastio() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
int n, m, q;
long long BIT[2505][2505];
map<pair<pair<int, int>, pair<int, int> >, long long> M;
void Update(int x, int y, long long val) {
  for (int i = x; i <= n; i += (i & -i)) {
    for (int j = y; j <= m; j += (j & -j)) {
      BIT[i][j] ^= val;
    }
  }
}
long long Get(int x, int y) {
  long long ans = 0;
  for (int i = x; i > 0; i -= (i & -i)) {
    for (int j = y; j > 0; j -= (j & -j)) {
      ans ^= BIT[i][j];
    }
  }
  return ans;
}
signed main() {
  Fastio();
  cin >> n >> m >> q;
  while (q--) {
    int op, c1, r1, c2, r2;
    cin >> op >> r1 >> c1 >> r2 >> c2;
    if (op == 3) {
      if (Get(r1, c1) == Get(r2, c2)) {
        cout << "Yes\n";
      } else {
        cout << "No\n";
      }
    } else {
      if (op == 1 and
          M.count(make_pair(make_pair(r1, c1), make_pair(r2, c2))) == false) {
        M[make_pair(make_pair(r1, c1), make_pair(r2, c2))] = rng();
      }
      long long val = M[make_pair(make_pair(r1, c1), make_pair(r2, c2))];
      Update(r1, c1, val);
      Update(r1, c2 + 1, val);
      Update(r2 + 1, c1, val);
      Update(r2 + 1, c2 + 1, val);
    }
  }
}
