#include <bits/stdc++.h>
template <class T>
bool minimize(T &a, T const &b) {
  return a > b ? a = b, 1 : 0;
}
template <class T>
bool maximize(T &a, T const &b) {
  return a < b ? a = b, 1 : 0;
}
using namespace std;
using ll = long long;
using vl = vector<ll>;
using pl = pair<ll, ll>;
using vp = vector<pl>;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll MAX = 1e5 + 5;
ll n, m, q;
ll bit[2505][2505];
void update(ll i, ll j, ll val) {
  for (; i <= n; i += i & -i)
    for (ll jj = j; jj <= m; jj += jj & -jj) bit[i][jj] += val;
}
ll query(ll i, ll j) {
  ll res = 0;
  for (; i > 0; i -= i & -i)
    for (ll jj = j; jj > 0; jj -= jj & -jj) res += bit[i][jj];
  return res;
}
void update(ll r1, ll c1, ll r2, ll c2, ll val) {
  update(r1, c1, val);
  update(r1, c2 + 1, -val);
  update(r2 + 1, c1, -val);
  update(r2 + 1, c2 + 1, val);
}
ll getRand() { return rand() * (rand() + 1) + rand(); }
map<pair<pl, pl>, ll> h;
void solve() {
  srand(time(0));
  cin >> n >> m >> q;
  ll r1, c1, r2, c2, t;
  for (ll i(1), _b(q); i <= _b; ++i) {
    cin >> t >> r1 >> c1 >> r2 >> c2;
    if (t == 1) {
      ll tmp = h[{{r1, c1}, {r2, c2}}] = getRand();
      update(r1, c1, r2, c2, tmp);
    } else if (t == 2) {
      ll tmp = h[{{r1, c1}, {r2, c2}}];
      update(r1, c1, r2, c2, -tmp);
    } else {
      ll t1 = query(r1, c1);
      ll t2 = query(r2, c2);
      (t1 == t2) ? cout << "Yes\n" : cout << "No\n";
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int TC = 1;
  for (ll i(1), _b(TC); i <= _b; ++i) {
    solve();
  }
  return 0;
}
