#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include<bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
int n,m;
cin>>n>>m;
string s;
cin>>s;
int dp[n+1][n+1];
for(int i=0;i<=n;i++) {
for(int j=0;j<=n;j++) {
dp[i][j]=0;
}
}
for(int i=0;i<=n;i++) {
dp[0][i]= dp[1][i]=1;
}
for(int i=2;i<=n;i++) {
for(int j=i-1;j<n;j++) {
if(s[j]==s[j-i+1] && dp[i-2][j-1]==1) {
dp[i][j]=1;
}
else {
dp[i][j]=0;
}
}
}
// for(int i=0;i<=n;i++) {
// for(int j=0;j<=n;j++) {
// cout<<dp[i][j]<<" ";
// }
// cout<<endl;
// }
for(int i=0;i<m;i++) {
int a,b;
cin>>a>>b;
if(b-a+1>n || b-a+1<0) {
cout<<"no"<<endl;
}
else if(dp[b-a+1][b-1]==1) {
cout<<"yes"<<endl;
}
else {
cout<<"no"<<endl;
}
}
return 0;
}