#include <bits/stdc++.h>
using namespace std;
const int MaxN = 3000, Pow = 998244353, Pt = 1e9 + 7;
int n, m, Q;
long long c[MaxN + 5][MaxN + 5];
map<pair<pair<int, int>, pair<int, int> >, int> vis;
int Lowbit(int x) { return (x & (-x)); }
void Add(int x, int y, long long t) {
  for (int i = x; i <= n + 5; i += Lowbit(i))
    for (int j = y; j <= m + 5; j += Lowbit(j)) c[i][j] += t;
}
int Sigma(int x, int y) {
  long long res = 0;
  for (int i = x; i > 0; i -= Lowbit(i))
    for (int j = y; j > 0; j -= Lowbit(j)) res += c[i][j];
  return res;
}
long long getrand(long long a, long long b, long long c, long long d) {
  return (((((a * Pow + b) % Pt) * Pow + c) % Pt) * Pow + d) % Pt;
}
int main() {
  while (~scanf("%d%d%d", &n, &m, &Q)) {
    memset(c, 0, sizeof(c));
    for (int i = 1; i <= Q; i++) {
      int t, lx, ly, rx, ry;
      scanf("%d%d%d%d%d", &t, &lx, &ly, &rx, &ry);
      if (t == 1) {
        long long u = vis[make_pair(make_pair(lx, ly), make_pair(rx, ry))] =
            getrand(lx, ly, rx, ry);
        Add(lx, ly, u);
        Add(rx + 1, ly, -u);
        Add(lx, ry + 1, -u);
        Add(rx + 1, ry + 1, u);
      } else if (t == 2) {
        long long u = vis[make_pair(make_pair(lx, ly), make_pair(rx, ry))];
        Add(lx, ly, -u);
        Add(rx + 1, ly, u);
        Add(lx, ry + 1, u);
        Add(rx + 1, ry + 1, -u);
      } else {
        long long p1 = Sigma(lx, ly);
        long long p2 = Sigma(rx, ry);
        if (p1 == p2)
          printf("Yes\n");
        else
          printf("No\n");
      }
    }
  }
  return 0;
}
