A, B = gets.split.map(&:to_i) M = (1..Math.sqrt(A).floor).select{|n| A % n == 0}.map{|n| [n, A / n, -n, -(A / n)]}.flatten puts M.any?{|m| m % B == 0} ? "YES" : "NO"