#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<vector<int> > v;
vector<vector<int> > dp1;
vector<int> dp2;
int main() {
  cin >> n >> m;
  dp2.resize(100001);
  vector<int> vv(m + 1);
  for (int i = 0; i < n; i++) {
    v.push_back(vv);
    dp1.push_back(vv);
    for (int j = 0; j < m; j++) {
      scanf("%d", &v[i][j]);
    }
  }
  int a = 0;
  for (int i = 0; i < m; i++) {
    dp1[0][i] = 1;
    for (int j = 1; j < n; j++) {
      if (v[j][i] >= v[j - 1][i]) {
        dp1[j][i] = dp1[j - 1][i] + 1;
      } else {
        dp1[j][i] = 1;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    a = 0;
    for (int j = 0; j < m; j++) {
      if (dp1[i][j] > a) a = dp1[i][j];
    }
    dp2[i] = a;
  }
  int k, x, y;
  cin >> k;
  int q[k];
  int qq[k];
  for (int i = 0; i < k; i++) {
    scanf("%d %d", &q[i], &qq[i]);
  }
  for (int i = 0; i < k; i++) {
    if (dp2[qq[i] - 1] >= qq[i] - q[i] + 1)
      printf("Yes\n");
    else
      printf("No\n");
  }
  return 0;
}
