import java.io.*; import java.util.Scanner; public class Main_yukicoder882 { private static Scanner sc; private static Printer pr; private static void solve() { int a = sc.nextInt(); int b = sc.nextInt(); for (int d = 1; d <= a; d++) { if (a % d == 0 && d % b == 0) { pr.println("YES"); return; } } pr.println("NO"); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }