#include <bits/stdc++.h>
using namespace std;
map<pair<pair<int, int>, pair<int, int> >,
    pair<unsigned long long, unsigned long long> >
    mp;
pair<unsigned long long, unsigned long long> t[2505][2505];
int n, m, q;
unsigned long long rnd() {
  unsigned long long x = 0;
  for (int i = 1; i <= 10; i++) x = x * 23333 + rand();
  return x;
}
void add(int x, int y, pair<unsigned long long, unsigned long long> v) {
  for (int i = x; i <= n; i += i & (-i))
    for (int j = y; j <= m; j += j & (-j))
      t[i][j].first += v.first, t[i][j].second += v.second;
}
pair<unsigned long long, unsigned long long> ask(int x, int y) {
  pair<unsigned long long, unsigned long long> s;
  for (int i = x; i; i -= i & (-i))
    for (int j = y; j; j -= y & (-j))
      s.first += t[i][j].first, s.second += t[i][j].second;
  return s;
}
int main() {
  scanf("%d%d%d", &n, &m, &q);
  srand(time(NULL));
  while (q--) {
    int fl, x, y, X, Y;
    scanf("%d%d%d%d%d", &fl, &x, &y, &X, &Y);
    pair<unsigned long long, unsigned long long> a, b;
    if (fl == 1) {
      a.first = rnd();
      a.second = rnd();
      b = make_pair(-a.first, -a.second);
      mp[make_pair(make_pair(x, y), make_pair(X, Y))] = a;
      add(x, y, a);
      add(X + 1, Y + 1, a);
      add(x, Y + 1, b);
      add(X + 1, y, b);
    } else if (fl == 2) {
      a = mp[make_pair(make_pair(x, y), make_pair(X, Y))];
      b = make_pair(-a.first, -a.second);
      add(x, y, b);
      add(X + 1, Y + 1, b);
      add(x, Y + 1, a);
      add(X + 1, y, a);
    } else {
      a = ask(x, y);
      b = ask(X, Y);
      puts(a == b ? "Yes" : "No");
    }
  }
}
