import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter ou = new PrintWriter(System.out); long a = Long.parseLong(sc.next()); long b = Long.parseLong(sc.next()); long c = a % b; long e = b; while(c != 0){ a = b; b = c; c = a % b; } e /= b; while(e % 2 == 0) e /= 2; while(e % 5 == 0) e /= 5; if(e != 1) ou.println("Yes"); else ou.println("No"); ou.flush(); sc.close(); } }