x, y = map(int, input().split()) n = int(input()) a = list(map(int, input().split())) x = x*10 / 36 y = y*10 / 36 for i in range(n-1): t = a[i] / x yl = int(t * y) print(a[i], a[i+1], yl) if yl > a[i+1]: print('NO') break else: print('YES')