from re import I N, Q = map(int, input().split()) A =list(map(int, input().split())) S = input() t = list(map(int, input().split())) bit = [1<