#include <bits/stdc++.h>
using namespace std;
int N, M, Q;
pair<int, int> e[200201];
int res[200201];
int isBi = 1;
int p[200201], col[200201], rnk[200201], bi[200201];
vector<array<int, 5> > undo;
pair<int, int> Find(int n) {
  if (n == p[n]) return make_pair(n, 0);
  auto ret = Find(p[n]);
  ret.second ^= col[n];
  return ret;
}
void Union(int a, int b) {
  auto ita = Find(a), itb = Find(b);
  a = ita.first;
  b = itb.first;
  if (a == b) {
    undo.push_back({a, a, 0, bi[a], isBi});
    if (ita.second == itb.second) bi[a] = 0, isBi = 0;
    return;
  }
  if (rnk[a] > rnk[b]) swap(a, b);
  p[a] = b;
  col[a] = ita.second ^ itb.second ^ 1;
  if (rnk[a] == rnk[b])
    rnk[b]++, undo.push_back({a, b, 1, bi[b], isBi});
  else
    undo.push_back({a, b, 0, bi[b], isBi});
  bi[b] &= bi[a];
  isBi &= bi[b];
}
void Undo() {
  auto [a, b, r, bb, bbb] = undo.back();
  undo.pop_back();
  p[a] = a;
  if (r) rnk[b]--;
  bi[b] = bb;
  isBi = bbb;
}
void dnc(int L, int R, int le, int ri) {
  int mid = L + R >> 1;
  res[mid] = min(ri, mid + 1);
  int cnt = 0;
  for (int i = R; i > mid; i--) Union(e[i].first, e[i].second), cnt++;
  if (isBi == 0)
    res[mid] = le;
  else {
    for (int i = le + 1; i <= min(ri - 1, mid); i++) {
      Union(e[i].first, e[i].second);
      cnt++;
      if (isBi == 0) {
        res[mid] = i;
        break;
      }
    }
  }
  while (cnt > 0) Undo(), cnt--;
  if (L <= mid - 1) {
    for (int i = R; i >= mid; i--) Union(e[i].first, e[i].second), cnt++;
    dnc(L, mid - 1, le, res[mid]);
    while (cnt > 0) Undo(), cnt--;
  }
  if (mid + 1 <= R) {
    for (int i = le + 1; i <= res[mid]; i++)
      Union(e[i].first, e[i].second), cnt++;
    dnc(mid + 1, R, res[mid], ri);
    while (cnt > 0) Undo(), cnt--;
  }
}
int main() {
  for (int i = 0; i < 200201; i++) p[i] = i, bi[i] = 1;
  scanf("%d %d %d", &N, &M, &Q);
  for (int i = 1; i <= M; i++) scanf("%d %d", &e[i].first, &e[i].second);
  dnc(1, M, 0, M + 1);
  while (Q--) {
    int l, r;
    scanf("%d %d", &l, &r);
    if (l <= res[r])
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
