#include<iostream>
using namespace std;

int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	
	bool f=0;
	for(int i=0;i<a;i++){
		if((b*i+c)%a==0){
			f=1;
			break;
		}
	}
	
	cout<<(f? "YES":"NO")<<endl;
	
	return 0;
}
