#include<bits/stdc++.h>
using namespace std;
const int MaxN=1e6;
const int MaxA=1e9;
int N, Q, L, R, x;
int A[MaxN];
int main(){
ios::sync_with_stdio(0);
cin.tie(0); cout.tie(0);
cin>>N>>Q;
for(int n=0; n<N; n+=1)
cin>>A[n];
sort(A,A+N);
for(int q=0; q<Q; q+=1){
cin>>L>>R;
x=upper_bound(A,A+N,R)-lower_bound(A,A+N,L);
(x==0)? cout<<"The candies are too short\n": cout<<x<<"\n";
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNvbnN0IGludCBNYXhOPTFlNjsKY29uc3QgaW50IE1heEE9MWU5OwppbnQgTiwgUSwgTCwgUiwgeDsKaW50IEFbTWF4Tl07CgppbnQgbWFpbigpewoJaW9zOjpzeW5jX3dpdGhfc3RkaW8oMCk7CgljaW4udGllKDApOyBjb3V0LnRpZSgwKTsKCQoJY2luPj5OPj5ROwoJZm9yKGludCBuPTA7IG48Tjsgbis9MSkKCQljaW4+PkFbbl07CgkKCXNvcnQoQSxBK04pOwoJZm9yKGludCBxPTA7IHE8UTsgcSs9MSl7CgkJY2luPj5MPj5SOwoJCXg9dXBwZXJfYm91bmQoQSxBK04sUiktbG93ZXJfYm91bmQoQSxBK04sTCk7CgkJKHg9PTApPyBjb3V0PDwiVGhlIGNhbmRpZXMgYXJlIHRvbyBzaG9ydFxuIjogY291dDw8eDw8IlxuIjsKCX0KfQ==