import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		sc.close();

		int cnt = 0;
		while (cnt < 100) {
			a %= b;
			if (a == 0) {
				System.out.println("No");
				return;
			}
			a *= 10;
			cnt++;
		}
		System.out.println("Yes");
	}
}