#include <bits/stdc++.h>
using namespace std;
const long long inf = 9.2e18;
const int maxn = 2507;
const int INF = 2.1e9;
const int MOD = 1e9 + 7;
const double dif = 1e-7;
const double PI = acos(-1.0);
int n, m, k, q;
long long lowbit(long long x) { return x & -x; }
long long C[maxn][maxn];
void add(int x, int y, long long v) {
  for (int i = x; i <= n; i += lowbit(i)) {
    for (int j = y; j <= m; j += lowbit(j)) {
      C[i][j] += v;
    }
  }
}
long long sum(int x, int y) {
  long long s = 0;
  for (int i = x; i; i -= lowbit(i)) {
    for (int j = y; j; j -= lowbit(j)) {
      s += C[i][j];
    }
  }
  return s;
}
long long sum(int x1, int y1, int x2, int y2) {
  return sum(x2, y2) - sum(x1, y2) - sum(x2, y1) + sum(x1, y1);
}
const long long seed = 19970404;
long long id(int x1, int y1, int x2, int y2) {
  return seed * (x1 + y2) + y1 + x2;
}
int main() {
  while (cin >> n >> m >> q) {
    memset(C, 0, sizeof(C));
    while (q--) {
      int t, r1, c1, r2, c2;
      cin >> t >> r1 >> c1 >> r2 >> c2;
      int x1 = min(r1, r2), x2 = max(r1, r2), y1 = min(c1, c2),
          y2 = max(c1, c2);
      if (t == 1) {
        long long v = id(x1, y1, x2, y2);
        add(x1, y1, v);
        add(x1, y2 + 1, -v);
        add(x2 + 1, y1, -v);
        add(x2 + 1, y2 + 1, v);
      } else if (t == 2) {
        long long v = id(x1, y1, x2, y2);
        add(x1, y1, -v);
        add(x1, y2 + 1, v);
        add(x2 + 1, y1, v);
        add(x2 + 1, y2 + 1, -v);
      } else {
        long long ans1 = sum(r1, c1), ans2 = sum(r2, c2);
        if (ans1 == ans2)
          cout << "Yes" << endl;
        else
          cout << "No" << endl;
      }
    }
  }
  return 0;
}
