#include <bits/stdc++.h>
using namespace std;
unsigned long long a[2550][2550];
struct FastIO {
  static const int S = 1310720;
  int wpos;
  char wbuf[S], endofFile;
  FastIO() : wpos(0), endofFile(0) {}
  inline int xchar() {
    if (endofFile) exit(0);
    static char buf[S];
    static int len = 0, pos = 0;
    if (pos == len) pos = 0, len = fread(buf, 1, S, stdin);
    if (pos == len) {
      endofFile = 1;
      return '\n';
    }
    return buf[pos++];
  }
  inline unsigned long long xuint() {
    int c = xchar();
    unsigned long long x = 0;
    while (c <= 32) {
      c = xchar();
    }
    for (; '0' <= c && c <= '9'; c = xchar()) x = x * 10 + c - '0';
    return x;
  }
  inline void wchar(int x) {
    if (wpos == S) fwrite(wbuf, 1, S, stdout), wpos = 0;
    wbuf[wpos++] = x;
  }
  inline void wstring(const char *s) {
    while (*s) {
      wchar(*s++);
    }
  }
  ~FastIO() {
    if (wpos) fwrite(wbuf, 1, wpos, stdout), wpos = 0;
  }
} io;
int n, m, q;
int lowbit(int x) { return x & -x; }
void add(int x, int y, unsigned long long seed) {
  for (int i = x; i <= n; i += lowbit(i))
    for (int j = y; j <= m; j += lowbit(j)) a[i][j] ^= seed;
}
unsigned long long query(int x, int y) {
  unsigned long long ret = 0;
  for (int i = x; i > 0; i -= lowbit(i))
    for (int j = y; j > 0; j -= lowbit(j)) ret ^= a[i][j];
  return ret;
}
int main() {
  mt19937 gen(time(NULL));
  uniform_int_distribution<> dis(0, INT_MAX);
  map<vector<int>, unsigned long long> mp;
  n = io.xuint(), m = io.xuint(), q = io.xuint();
  set<vector<int> > cache;
  while (q--) {
    int op = io.xuint();
    int x1 = io.xuint(), y1 = io.xuint(), x2 = io.xuint(), y2 = io.xuint();
    if (op == 1) {
      if (x1 > x2) swap(x1, x2);
      if (y1 > y2) swap(y1, y2);
      unsigned long long seed = dis(gen);
      seed = seed << 32 | dis(gen);
      mp[vector<int>{x1, y1, x2, y2}] = seed;
      cache.emplace(vector<int>{x1, y1, x2, y2});
    } else if (op == 2) {
      if (x1 > x2) swap(x1, x2);
      if (y1 > y2) swap(y1, y2);
      auto it = mp.find(vector<int>{x1, y1, x2, y2});
      if (it != mp.end()) {
        auto is = cache.find(vector<int>{x1, y1, x2, y2});
        if (is != cache.end()) {
          cache.erase(is);
        } else {
          unsigned long long seed = it->second;
          add(x1, y1, seed);
          add(x1, y2 + 1, seed);
          add(x2 + 1, y1, seed);
          add(x2 + 1, y2 + 1, seed);
          mp.erase(it);
        }
      }
    } else {
      for (auto &v : cache) {
        unsigned long long seed = mp[v];
        add(v[0], v[1], seed);
        add(v[0], v[3] + 1, seed);
        add(v[2] + 1, v[1], seed);
        add(v[2] + 1, v[3] + 1, seed);
      }
      cache.clear();
      unsigned long long seed1 = query(x1, y1), seed2 = query(x2, y2);
      if (seed1 == seed2)
        io.wstring("Yes\n");
      else
        io.wstring("No\n");
    }
  }
  return 0;
}
