#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Cin(T& x) {
  char c;
  T sign = 1;
  x = 0;
  for (c = getchar(); c < '0' || c > '9'; c = getchar())
    if (c == '-') sign = -1;
  for (; c >= '0' && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sign;
}
template <typename T>
inline void Out(T x) {
  if (x > 9) Out(x / 10);
  putchar(x % 10 + '0');
}
template <typename T>
inline void Cout(T x, char c) {
  if (x < 0) putchar('-');
  x = abs(x);
  Out(x);
  putchar(c);
}
template <typename T, typename... Args>
inline void Cin(T& a, Args&... args) {
  Cin(a);
  Cin(args...);
}
template <typename T, typename... Args>
inline void Cout(T a, char c, Args... args) {
  Cout(a, c);
  Cout(args...);
}
const int N = 2507;
struct Rect {
  int x, y, u, v;
  bool operator<(const Rect& r) const& {
    if (x != r.x) return x < r.x;
    if (y != r.y) return y < r.y;
    if (u != r.u) return u < r.u;
    return v < r.v;
  }
};
struct BIT {
  int n, m;
  long long t[N][N];
  BIT(int n = 0, int m = 0) : n(n), m(m) {}
  void Update(int x, int y, long long v) {
    while (x <= n) {
      int i = y;
      while (i <= m) {
        t[x][i] += v;
        i += (i & -i);
      }
      x += (x & -x);
    }
  }
  long long Query(int x, int y) {
    long long res = 0;
    while (x > 0) {
      int i = y;
      while (i > 0) {
        res += t[x][i];
        i -= (i & -i);
      }
      x -= (x & -x);
    }
    return res;
  }
  void Update(Rect r, long long v) {
    Update(r.x, r.y, v);
    Update(r.u + 1, r.v + 1, v);
    Update(r.x, r.v + 1, -v);
    Update(r.u + 1, r.y, -v);
  }
} s;
map<Rect, long long> mmap;
long long Rand(long long l, long long h) {
  return l +
         ((long long)rand() * (RAND_MAX + 1) * (RAND_MAX + 1) * (RAND_MAX + 1) +
          (long long)rand() * (RAND_MAX + 1) * (RAND_MAX + 1) +
          (long long)rand() * (RAND_MAX + 1) + rand()) %
             (h - l + 1);
}
int n, m, q;
void Enter() {
  Cin(n, m, q);
  srand(time(NULL));
  s = BIT(n, m);
  while (q--) {
    int cmd;
    Rect r;
    Cin(cmd, r.x, r.y, r.u, r.v);
    if (cmd == 1) {
      long long& v = mmap[r];
      v = Rand(100000000, 1000000000000);
      s.Update(r, v);
    } else if (cmd == 2) {
      long long& v = mmap[r];
      s.Update(r, -v);
    } else {
      if (s.Query(r.x, r.y) == s.Query(r.u, r.v))
        cout << "Yes\n";
      else
        cout << "No\n";
    }
  }
}
void Solve() {}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  Enter();
  Solve();
  return 0;
}
