#include <bits/stdc++.h>
int nrows, ncols, qsize, r, srow, scol, drow, dcol;
std::map<std::tuple<int, int, int, int>, int> m;
constexpr int32_t mm[2] = {1000000007, 1000000009}, nm = 1;
struct Hash {
  int32_t h[nm];
  Hash() {
    for (size_t i = 0; i < nm; ++i) h[i] = 0;
  }
  Hash(int64_t ini) {
    for (size_t i = 0; i < nm; ++i) h[i] = (mm[i] + ini % mm[i]) % mm[i];
  }
  bool operator==(const Hash& hash) const {
    for (size_t i = 0; i < nm; ++i)
      if (h[i] != hash.h[i]) return false;
    return true;
  }
  Hash operator+(const Hash& hash) const {
    Hash nh;
    for (size_t i = 0; i < nm; ++i) nh.h[i] = (h[i] + hash.h[i]) % mm[i];
    return nh;
  }
  Hash& operator+=(const Hash& hash) {
    for (size_t i = 0; i < nm; ++i) h[i] = (h[i] + hash.h[i]) % mm[i];
    return *this;
  }
};
std::ostream& operator<<(std::ostream& stream, const Hash& hash) {
  for (size_t i = 0; i < nm; ++i) stream << (i == 0 ? "[" : ":") << hash.h[i];
  return stream << "]";
}
Hash tree[8192][8192];
size_t count;
void add(int arow, int acol, int brow, int bcol, int64_t change, int node1,
         int node2, int xrow, int xcol, int yrow, int ycol) {
  if (xrow > yrow || xcol > ycol) {
    return;
  } else if (arow > yrow || acol > ycol || brow < xrow || bcol < xcol) {
    return;
  } else if (arow <= xrow && acol <= xcol && brow >= yrow && bcol >= ycol) {
    ++count;
    tree[node1][node2] += Hash(change);
  } else {
    if (arow > xrow || brow < yrow) {
      add(arow, acol, brow, bcol, change, node1 * 2 + 0, node2, xrow, xcol,
          (yrow + xrow) / 2 + 0, ycol);
      add(arow, acol, brow, bcol, change, node1 * 2 + 1, node2,
          (yrow + xrow) / 2 + 1, xcol, yrow, ycol);
    } else {
      add(arow, acol, brow, bcol, change, node1, node2 * 2 + 0, xrow, xcol,
          yrow, (xcol + ycol) / 2 + 0);
      add(arow, acol, brow, bcol, change, node1, node2 * 2 + 1, xrow,
          (ycol + xcol) / 2 + 1, yrow, ycol);
    }
  }
}
void add(int arow, int acol, int brow, int bcol, int64_t change) {
  add(arow, acol, brow, bcol, change, 1, 1, 1, 1, nrows, ncols);
}
Hash get(int row, int col, int node1, int node2, int xrow, int xcol, int yrow,
         int ycol) {
  if (xrow > yrow || xcol > ycol) {
    return Hash(0);
  } else if (row < xrow || col < xcol || row > yrow || col > ycol) {
    return Hash(0);
  } else if (xrow == yrow && xcol == ycol) {
    return tree[node1][node2];
  } else {
    auto result = tree[node1][node2];
    if (xcol == 1 && ycol == ncols && xrow != yrow) {
      result += get(row, col, 2 * node1 + 0, node2, xrow, xcol,
                    (xrow + yrow) / 2 + 0, ycol);
      result += get(row, col, 2 * node1 + 1, node2, (xrow + yrow) / 2 + 1, xcol,
                    yrow, ycol);
    }
    if (xcol != ycol) {
      result += get(row, col, node1, 2 * node2 + 0, xrow, xcol, yrow,
                    (xcol + ycol) / 2 + 0);
      result += get(row, col, node1, 2 * node2 + 1, xrow, (xcol + ycol) / 2 + 1,
                    yrow, ycol);
    }
    return result;
  }
}
Hash get(int row, int col) {
  auto hash = get(row, col, 1, 1, 1, 1, nrows, ncols);
  return hash;
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cout.tie(nullptr);
  std::cin.tie(nullptr);
  std::cin >> nrows >> ncols >> qsize;
  srand(nrows * mm[0] + ncols * mm[1] + qsize);
  for (int q = 1; q <= qsize; ++q) {
    std::cin >> r >> srow >> scol >> drow >> dcol;
    if (r == 1) {
      m[std::make_tuple(srow, scol, drow, dcol)] =
          static_cast<int64_t>(rand() << 16) + (rand() << 8) + rand();
      add(srow, scol, drow, dcol, m[std::make_tuple(srow, scol, drow, dcol)]);
    } else if (r == 2) {
      add(srow, scol, drow, dcol, -m[std::make_tuple(srow, scol, drow, dcol)]);
    } else if (r == 3) {
      if (get(srow, scol) == get(drow, dcol))
        std::cout << "Yes\n";
      else
        std::cout << "No\n";
    }
  }
}
