#include <bits/stdc++.h>
using namespace std;
int mult(int x, int y) {
  long long int ans, x1 = (long long int)x, y1 = (long long int)y;
  ans = (x1 * y1) % 1000000007;
  return (int)ans;
}
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
int lcm(int a, int b) { return a * (b / gcd(a, b)); }
long long int pow1(long long int a, long long int b) {
  long long int ans = 1;
  while (b > 0) {
    if (b & 1) ans = (ans * a) % 1000000007;
    a = (a * a) % 1000000007;
    b >>= 1;
  }
  return ans;
}
vector<vector<int> > v, v1;
int pre[100005];
int main() {
  int n, m, i, j, k;
  scanf("%d", &n);
  scanf("%d", &m);
  v.resize(n + 2);
  v1.resize(n + 2);
  for (i = 0; i < n + 2; i++) {
    v[i].resize(m + 2);
    v1[i].resize(m + 2);
  }
  for (i = 1; i < n + 1; i++)
    for (j = 1; j < m + 1; j++) scanf("%d", &v[i][j]);
  for (i = 1; i < m + 1; i++) v1[n][i] = n;
  for (i = n - 1; i >= 1; i--) {
    for (j = 1; j < m + 1; j++) {
      if (v[i][j] <= v[i + 1][j])
        v1[i][j] = v1[i + 1][j];
      else
        v1[i][j] = i;
    }
  }
  for (i = 1; i < n + 1; i++) pre[i] = -INT_MAX;
  for (i = 1; i < n + 1; i++) {
    for (j = 1; j < m + 1; j++) pre[i] = max(pre[i], v1[i][j]);
  }
  scanf("%d", &k);
  int x, y;
  while (k--) {
    scanf("%d", &x);
    scanf("%d", &y);
    if (pre[x] >= y)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
