#include <bits/stdc++.h>
using namespace std;
bool checkBit(long long n, int i) { return n & (1LL << i); }
long long setBit(long long n, int i) {
  return n | (1LL << i);
  ;
}
long long resetBit(long long n, int i) { return n & (~(1LL << i)); }
template <typename T>
T POW(T b, T p) {
  T r = 1;
  while (p) {
    if (p & 1) r = (r * b);
    b = (b * b);
    p >>= 1;
  }
  return r;
}
long long big_mod(long long n, long long p) {
  if (p == 0) return 1;
  if (!(p & 1)) {
    long long r = big_mod(n, p / 2) % 1000000007;
    return ((r % 1000000007) * (r % 1000000007)) % 1000000007;
  } else
    return ((n % 1000000007) * (big_mod(n, p - 1) % 1000000007)) % 1000000007;
}
long long gcd(long long a, long long b) {
  while (b != 0) {
    long long t = a % b;
    a = b;
    b = t;
  }
  return a;
}
long long ar[100010], br[100010], reserve[100010];
int main() {
  long long row, col, query, l, r;
  while (cin >> row >> col) {
    long long cr[row + 10][col + 10];
    for (int i = 1; i < (row + 1); i++) {
      for (int j = 1; j < (col + 1); j++) {
        cin >> ar[j];
        if (ar[j] >= br[j]) {
          cr[i][j] = cr[i - 1][j] + 1;
          br[j] = ar[j];
        } else {
          br[j] = ar[j];
          cr[i][j] = 1;
        }
      }
    }
    long long maximum = 0;
    for (int i = 1; i < (row + 1); i++) {
      maximum = 0;
      for (int j = 1; j < (col + 1); j++) {
        maximum = max(maximum, cr[i][j]);
      }
      reserve[i] = maximum;
    }
    cin >> query;
    int flag = 0;
    for (int i = 0; i < (query); i++) {
      cin >> l >> r;
      flag = 0;
      for (int j = 1; j <= col; j++) {
        if (reserve[r] >= ((r - l) + 1)) {
          flag = 1;
          break;
        }
      }
      if (flag)
        cout << "Yes" << endl;
      else
        cout << "No" << endl;
    }
  }
}
