#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 2;
const int M = 1e5 + 2;
const int mod = 1e9 + 7;
const int inf = 1e9;
const long long INF = 1e16;
void data() {}
template <typename T>
void scerr(T nums) {
  for (auto it : nums) cerr << it << " | ";
  cerr << "\n";
}
int n, m, q, l, r;
int main() {
  data();
  scanf("%d %d", &n, &m);
  int a[n + 1][m + 1], dp[n + 1][m + 1], mx[n + 1];
  memset(dp, 0, sizeof dp);
  memset(a, 0, sizeof a);
  memset(mx, 0, sizeof mx);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) scanf("%d", &a[i][j]);
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (a[i][j] >= a[i - 1][j]) dp[i][j] = dp[i - 1][j] + 1;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) mx[i] = max(mx[i], dp[i][j]);
  scanf("%d", &q);
  while (q--) {
    scanf("%d %d", &l, &r);
    if (r - mx[r] <= l)
      printf("Yes\n");
    else
      printf("No\n");
  }
}
