import math def main(): X,A,Y,B = map(int, input().split( )) S =X**A for num in range(A): if S%A ==0: S =X**A/B else: print("No") S = -1 break if S>=0: print("Yes") if __name__ == '__main__': main()