#include <bits/stdc++.h>
using namespace std;
string DaoNguoc(string s) {
int length = s.length();
string temp;
for (int i = length-1; i >=0; i--) {
temp.push_back(s[i]);
}
return temp;
}
int main()
{
int a,b;
string s;cin >>s;
int n;cin >>n;
for(int i = 1 ; i<= n;i++)
{
cin >>a>>b;
if(s.substr(a-1,b-a+1) == DaoNguoc(s.substr(a-1,b-a+1)))
{
cout<<"YES\n";
}
else
{
cout<<"NO\n";
}
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnN0cmluZyBEYW9OZ3VvYyhzdHJpbmcgcykgewogICAgaW50IGxlbmd0aCA9IHMubGVuZ3RoKCk7CiAgICBzdHJpbmcgdGVtcDsKICAgIGZvciAoaW50IGkgPSBsZW5ndGgtMTsgaSA+PTA7IGktLSkgewogICAgICAgIHRlbXAucHVzaF9iYWNrKHNbaV0pOwogICAgfQogICAgcmV0dXJuIHRlbXA7Cn0KaW50IG1haW4oKQp7CglpbnQgYSxiOwoJc3RyaW5nIHM7Y2luID4+czsKCWludCBuO2NpbiA+Pm47Cglmb3IoaW50IGkgPSAxIDsgaTw9IG47aSsrKQoJewoJCWNpbiA+PmE+PmI7CgkJaWYocy5zdWJzdHIoYS0xLGItYSsxKSA9PSBEYW9OZ3VvYyhzLnN1YnN0cihhLTEsYi1hKzEpKSkKCQl7CgkJCWNvdXQ8PCJZRVNcbiI7CgkJfQoJCWVsc2UKCQl7CgkJCWNvdXQ8PCJOT1xuIjsKCQl9Cgl9CglyZXR1cm4gMDsKfQo=