#include <bits/stdc++.h>
using namespace std;
class fenwick_tree_2d {
  vector<vector<long long>> t;
  long long nn, mm;

 public:
  fenwick_tree_2d(long long n, long long m) {
    t.assign(n + 1, vector<long long>(m + 1, 0));
    nn = n;
    mm = m;
  }
  inline long long LSOne(long long k) { return k & (-k); }
  void update(long long x, long long y, long long val) {
    long long xx, yy;
    for (xx = x; xx <= nn; xx += LSOne(xx)) {
      for (yy = y; yy <= mm; yy += LSOne(yy)) t[xx][yy] += val;
    }
  }
  long long query_full(long long x1, long long y1, long long x2, long long y2) {
    long long ans;
    ans = query(x2, y2) - query(x1 - 1, y2) - query(x2, y1 - 1) +
          query(x1 - 1, y1 - 1);
  }
  long long query(long long x, long long y) {
    if ((x == 0) || (y == 0)) return 0;
    long long xx, yy, ans = 0;
    for (xx = x; xx > 0; xx -= LSOne(xx)) {
      for (yy = y; yy > 0; yy -= LSOne(yy)) ans += t[xx][yy];
    }
    return ans;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m, q, i, j, k, tt, r1, c1, r2, c2, ans, hh, v, a, b;
  unordered_map<long long, long long> h;
  cin >> n >> m >> q;
  fenwick_tree_2d ft(n, m);
  while (q--) {
    cin >> tt >> r1 >> c1 >> r2 >> c2;
    if (tt == 1) {
      hh = ((rand() % 10000LL) * 10000 + (rand() % 10000)) * 10000 +
           (rand() % 10000);
      v = ((r1 * 10000 + r2) * 10000 + c1) * 10000 + c2;
      h[v] = hh;
      ft.update(r1, c1, hh);
      ft.update(r2 + 1, c1, -hh);
      ft.update(r1, c2 + 1, -hh);
      ft.update(r2 + 1, c2 + 1, hh);
    }
    if (tt == 2) {
      v = ((r1 * 10000 + r2) * 10000 + c1) * 10000 + c2;
      hh = h[v];
      h.erase(v);
      ft.update(r1, c1, -hh);
      ft.update(r2 + 1, c1, hh);
      ft.update(r1, c2 + 1, hh);
      ft.update(r2 + 1, c2 + 1, -hh);
    }
    if (tt == 3) {
      a = ft.query(r1, c1);
      b = ft.query(r2, c2);
      if (a == b)
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
  return 0;
}
