x, y = map(int, input().split()) n = int(input()) p = list(map(int, input().split())) def f(x, y, n, p): x_s = x / 360 y_s = y / 360 for i in range(n - 1): if y_s * (p[i] // x_s) > p[i+1]: return 'NO' return ('YES') print(f(x, y, n, p))