#include <bits/stdc++.h>
using namespace std;
long long mod = 207;
long long a[3005][3005];
map<pair<pair<long long, long long>, pair<long long, long long> >, long long>
    mp;
long long n, m, t;
void add(long long x, long long y, long long v) {
  for (long long i = x; i <= n; i += (i & -i)) {
    for (long long j = y; j <= m; j += (j & -j)) {
      a[i][j] += v;
    }
  }
}
long long get(long long x, long long y) {
  long long ans = 0;
  for (long long i = x; i >= 1; i -= (i & -i)) {
    for (long long j = y; j >= 1; j -= (j & -j)) {
      ans += a[i][j];
    }
  }
  return ans;
}
int main() {
  while (cin >> n >> m >> t) {
    memset(a, 0, sizeof(a));
    mp.clear();
    long long dns = 1;
    while (t--) {
      long long l, c1, c2, c3, c4;
      cin >> l >> c1 >> c2 >> c3 >> c4;
      if (l == 1) {
        dns *= mod;
        mp[make_pair(make_pair(c1, c2), make_pair(c3, c4))] = dns;
        add(c1, c2, dns);
        add(c1, c4 + 1, -dns);
        add(c3 + 1, c4 + 1, dns);
        add(c3 + 1, c2, -dns);
      }
      if (l == 2) {
        long long kns = mp[make_pair(make_pair(c1, c2), make_pair(c3, c4))];
        add(c1, c2, -kns);
        add(c1, c4 + 1, kns);
        add(c3 + 1, c4 + 1, -kns);
        add(c3 + 1, c2, kns);
      }
      if (l == 3) {
        if (get(c1, c2) == get(c3, c4))
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    }
  }
}
