defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def f(a, b, st) do m = rem(a, b) cond do m == 0 -> false MapSet.member?(st, m) -> true true -> f(10*m, b, MapSet.put(st, m)) end end def main do [a, b] = li() case f(a, b, MapSet.new()) do true -> IO.puts "Yes" false -> IO.puts "No" end end end