#include <bits/stdc++.h>
using namespace std;
using ll = long long;
struct DSU {
int n;
vector<int> p, sz, f;
vector<pair<int *, int>> st;
int cur = 1;
DSU() {}
void init(int n) {
this->n = n;
p.resize(n);
iota(p.begin(), p.end(), 0);
sz.assign(n, 1);
f.assign(n, 0);
}
pair<int, int> leader(int x) {
int val = 0;
while (x != p[x]) {
val ^= f[x];
x = p[x];
}
return {x, val};
}
void save(int &x) { st.push_back({&x, x}); }
void unite(int a, int b) {
auto [ra, fa] = leader(a);
auto [rb, fb] = leader(b);
if (ra == rb) {
if (fa == fb && cur) {
save(cur);
cur = 0;
}
return;
}
if (sz[ra] < sz[rb]) {
swap(ra, rb);
swap(fa, fb);
}
save(p[rb]);
save(sz[ra]);
save(f[rb]);
p[rb] = ra;
sz[ra] += sz[rb];
f[rb] = fa ^ fb ^ 1;
}
int snapshot() { return (int)st.size(); }
void rollback(int a) {
while ((int)st.size() > a) {
auto [ptr, val] = st.back();
*ptr = val;
st.pop_back();
}
}
} dsu;
int n, m, q;
vector<pair<int, int>> e;
vector<int> R;
void dfs(int l = 0, int r = m - 1, int tl = 0, int tr = m - 1) {
if (tl > tr)
return;
int tm = (tl + tr) >> 1;
int sl = l, sr = r;
int snap = dsu.snapshot();
while (l < tm) {
dsu.unite(e[l].first, e[l].second);
l++;
}
while (r >= l && dsu.cur) {
dsu.unite(e[r].first, e[r].second);
r--;
}
R[tm] = r;
dsu.rollback(snap);
int ssr = sr;
while (sr > r) {
dsu.unite(e[sr].first, e[sr].second);
sr--;
}
dfs(sl, sr, tl, tm - 1);
dsu.rollback(snap);
while (sl < l) {
dsu.unite(e[sl].first, e[sl].second);
sl++;
}
dfs(sl, ssr, tm + 1, tr);
dsu.rollback(snap);
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n >> m >> q;
e.resize(m);
for (int i = 0, u, v; i < m; ++i) {
cin >> u >> v, --u, --v;
e[i] = {u, v};
}
R.resize(m);
dsu.init(n);
dfs();
for (int qq = 0, l, r; qq < q; ++qq) {
cin >> l >> r, --l, --r;
cout << (R[l] >= r ? "YES\n" : "NO\n");
}
return 0;
}