from collections import defaultdict from bisect import bisect def main(): X, Y = map(int, input().split()) N = int(input()) A_list = list(map(int, input().split())) for i in range(N): a = A_list[i] t = a / X s = Y * t p = bisect(A_list, s) if p > i + 1 and A_list[i + 1] != s: print("NO") break else: print("YES") if __name__ == '__main__': main()