#include <stdio.h> int main() { unsigned int a, b, c, t; for(; scanf("%d%d%d", &a, &b, &c), a || b || c; puts(c % b ? "NO" : "YES")) { if(a > b) t = a, a = b, b = t; for(; t = a % b; a = b, b = t); } return 0; }