from itertools import count def calc_prime_factorize(num: int) -> dict[int, int]: if num < 2: raise ValueError divisors = {} for divisor in count(2): if divisor ** 2 > num: if num != 1: divisors[num] = 1 break while num % divisor == 0 and num != 1: try: divisors[divisor] += 1 except KeyError: divisors[divisor] = 1 num //= divisor return divisors def main(): X, A, Y, B = map(int, input().split()) if Y == 1: print("Yes") return if X == 1: print("No") return X_factors = calc_prime_factorize(X) Y_factors = calc_prime_factorize(Y) for y_prime, count_ in Y_factors.items(): if y_prime not in X_factors: print("No") return if X_factors[y_prime]*A < count_ * B: print("No") return print("Yes") if __name__ == "__main__": main()