#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void smin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void smax(T &a, T b) {
  a = a > b ? a : b;
}
void err(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ", ";
  err(++it, args...);
}
template <typename T>
inline void Int(T &n) {
  n = 0;
  int f = 1;
  register int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
template <typename T, typename TT>
inline void Int(T &n, TT &m) {
  Int(n);
  Int(m);
}
template <typename T, typename TT, typename TTT>
inline void Int(T &n, TT &m, TTT &l) {
  Int(n, m);
  Int(l);
}
const int mod = (int)1e9 + 7;
inline int add(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
inline int mul(int a, int b) { return (long long)a * b % mod; }
const int inf = (int)2e9 + 5;
const long long Inf = (long long)2e18 + 5;
const int N = (int)2500 + 5;
int bit[N][N];
int n, m, q;
void inc(int x, int y, int val) {
  while (x <= n) {
    int s = y;
    while (s <= m) {
      bit[x][s] = add(bit[x][s], val);
      s += (s & -s);
    }
    x += (x & -x);
  }
}
void dec(int x, int y, int val) {
  while (x <= n) {
    int s = y;
    while (s <= m) {
      bit[x][s] = sub(bit[x][s], val);
      s += (s & -s);
    }
    x += (x & -x);
  }
}
int query(int x, int y) {
  int ans = 0;
  while (x > 0) {
    int s = y;
    while (s > 0) {
      ans = add(ans, bit[x][s]);
      s -= (s & -s);
    }
    x -= (x & -x);
  }
  return ans;
}
int solve() {
  Int(n, m, q);
  std::map<pair<pair<int, int>, pair<int, int> >, int> v;
  int id = 0;
  std::vector<int> two(q + 5, 1);
  for (int i = 1; i <= q; i++) {
    two[i] = mul(two[i - 1], 2);
  }
  while (q--) {
    int ck;
    Int(ck);
    if (ck == 1) {
      ++id;
      int r1, c1, r2, c2;
      Int(r1, c1);
      Int(r2, c2);
      v[make_pair(make_pair(r1, c1), make_pair(r2, c2))] = id;
      int val = two[id];
      inc(r1, c1, val);
      inc(r2 + 1, c2 + 1, val);
      dec(r1, c2 + 1, val);
      dec(r2 + 1, c1, val);
    } else if (ck == 2) {
      int r1, c1, r2, c2;
      Int(r1, c1);
      Int(r2, c2);
      int val = two[v[make_pair(make_pair(r1, c1), make_pair(r2, c2))]];
      dec(r1, c1, val);
      dec(r2 + 1, c2 + 1, val);
      inc(r1, c2 + 1, val);
      inc(r2 + 1, c1, val);
    } else {
      int r1, c1, r2, c2;
      Int(r1, c1);
      Int(r2, c2);
      if (query(r1, c1) == query(r2, c2))
        printf("Yes\n");
      else
        printf("No\n");
    }
  }
  return 0;
}
int main() {
  int test = 1, tc = 0;
  while (test--) {
    solve();
  }
  return 0;
}
