#include <bits/stdc++.h>
using namespace std;
int s[2][100005];
struct aa {
  int x, y, id;
} a[100005], b[100005];
int comp(aa p, aa q) { return p.x < q.x; }
int tot;
int tmp[100005];
int tree[100005];
int lowbit(int x) { return x & (-x); }
void add(int d, int x) {
  while (d < 100005) {
    tree[d] += x;
    d += lowbit(d);
  }
  return;
}
int sol(int x) {
  int ans = 0;
  while (x > 0) {
    ans += tree[x];
    x -= lowbit(x);
  }
  return ans;
}
void init() {
  tot = 0;
  memset(s, 0, sizeof(s));
  memset(tree, 0, sizeof(tree));
}
int aans[100005];
int main(void) {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    init();
    int t = 0;
    for (int i = 1; i <= n; i++) {
      for (int j = 0; j < m; j++) {
        scanf("%d", &s[t][j]);
        if (i == 1) tmp[j] = 1;
      }
      if (i == 1) {
        t = !t;
        continue;
      }
      for (int j = 0; j < m; j++) {
        if (s[t][j] < s[!t][j]) {
          a[tot].x = tmp[j];
          a[tot].y = i - 1;
          tmp[j] = i;
          tot++;
        }
      }
      t = !t;
    }
    for (int i = 0; i < m; i++) {
      a[tot].x = tmp[i];
      a[tot].y = n;
      tot++;
    }
    int q;
    scanf("%d", &q);
    for (int i = 0; i < q; i++) {
      scanf("%d%d", &b[i].x, &b[i].y);
      b[i].id = i;
    }
    sort(a, a + tot, comp);
    sort(b, b + q, comp);
    int now = 0;
    for (int i = 0; i < q; i++) {
      while (a[now].x <= b[i].x && now < tot) {
        add(a[now].y, 1);
        now++;
      }
      if (sol(b[i].y - 1) != now)
        aans[b[i].id] = 1;
      else
        aans[b[i].id] = 0;
    }
    for (int i = 0; i < q; i++) printf(aans[i] ? "Yes\n" : "No\n");
  }
  return 0;
}
