s=input() m=int(input()) for i in range(m): l,r,l1,r1=map(int,input().split()) if s[l:r+1] == s[l1:r1+1]: print("Yes") else: print("No")