#include <bits/stdc++.h>
using namespace std;
int N, M, Q, E[200005][2], MinGood[200005];
class UnionFindWithRollBacks {
  int Set[200005 + 200005][2];

 public:
  vector<int> Ops;
  void init() {
    for (int i = 1; i <= 2 * N; i++) {
      Set[i][0] = i;
      Set[i][1] = 1;
    }
  }
  int Find(int x) { return (Set[x][0] == x ? x : Find(Set[x][0])); }
  void UnionUtil(int x, int y) {
    int p1 = Find(x), p2 = Find(y);
    if (p1 != p2) {
      if (Set[p1][1] > Set[p2][1]) {
        swap(p1, p2);
      }
      Set[p1][0] = p2, Set[p2][1] += Set[p1][1];
      Ops.push_back(p1);
    } else {
      Ops.push_back(0);
    }
  }
  bool Union(int x, int y) {
    UnionUtil(x, y + N);
    UnionUtil(x + N, y);
    return (Find(x) == Find(x + N));
  }
  void rollbackUtil() {
    assert(Ops.size());
    int v = Ops.back();
    Set[Find(v)][1] -= Set[v][1];
    Set[v][0] = v;
    Ops.pop_back();
  }
  void rollback() {
    rollbackUtil();
    rollbackUtil();
  }
} UF, UF2;
void CDQ(int loR, int hiR, int loL, int hiL) {
  if (loR > hiR) {
    return;
  }
  int mid = (loR + hiR) >> 1, opt = mid - 1;
  bool okay = 0;
  for (int i = mid; i <= hiR; i++) {
    okay |= UF.Union(E[i][0], E[i][1]);
  }
  if (okay) {
    opt = 1;
    for (int i = 1; i <= mid; i++) {
      MinGood[i] = 0;
    }
  } else {
    for (int i = loL; i <= min(hiL, mid - 1); i++) {
      if (UF.Union(E[i][0], E[i][1])) {
        MinGood[mid] = opt = i;
        break;
      }
    }
    for (int i = loL; i <= opt; i++) {
      UF.rollback();
    }
    CDQ(loR, mid - 1, loL, opt);
  }
  for (int i = mid; i <= hiR; i++) {
    UF.rollback();
  }
  for (int i = loL; i < opt; i++) {
    UF.Union(E[i][0], E[i][1]);
  }
  CDQ(mid + 1, hiR, opt, hiL);
  for (int i = loL; i < opt; i++) {
    UF.rollback();
  }
}
int main() {
  scanf("%d %d %d", &N, &M, &Q);
  UF.init(), UF2.init();
  bool okay = false;
  for (int i = 1; i <= M; i++) {
    scanf("%d %d", &E[i][0], &E[i][1]);
    okay |= UF2.Union(E[i][0], E[i][1]);
    if (okay && !MinGood[M + 1]) {
      MinGood[M + 1] = i;
    }
  }
  if (!okay) {
    for (int i = 1; i <= Q; i++) {
      printf("NO\n");
    }
    return (0);
  }
  CDQ(1, M, 1, M);
  for (int i = 1; i <= Q; i++) {
    int li, ri;
    scanf("%d %d", &li, &ri);
    if (MinGood[ri + 1] < li) {
      printf("YES\n");
    } else {
      printf("NO\n");
    }
  }
}
