x, a, y, b = map(int, input().split()) print("YNeos"[(x**a) % (y**b) != 0::2])