import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  int a, b, c;
  readf("%s %s %s\n", &a, &b, &c);
  auto x = 1;
  bool[int] f;
  auto tc = a % b;
  bool res;
  while (f.get(tc, true)) {
    if (tc == c) {
      res = true;
      break;
    }
    f[tc] = false;
    x++;
    tc = (x * a) % b;
  }

  if (res) {
    writeln("YES");
  } else {
    writeln("NO");
  }
}
