n, q = input().split() nn, nq = int(n), int(q) for _ in range(nq): x = input() nx = int(x) print("Yes" if n in x or nx % nn == 0 else "No")