#include using namespace std; typedef unsigned long long ULL; const int N = 100010; const int P = 131; int n, m; string str; ULL h[N], b[N]; ULL get(int l, int r) { return h[r] - h[l - 1] * b[r - l + 1]; } int main() { cin >> n >> m >> str; b[0] = 1; // p^0=1,初始化 for (int i = 1; i <= n; i++) { b[i] = b[i - 1] * P; // 基数 h[i] = h[i - 1] * P + str[i - 1]; // 前缀和 } while (m--) { int l1, r1, l2, r2; cin >> l1 >> r1 >> l2 >> r2; if (get(l1, r1) == get(l2, r2)) puts("Yes"); else puts("No"); } return 0; }