#include
using namespace std;
int main()
{
long long m;
int k;
cin>>m>>k;
if(m%k==3)
cout<<"YES";
else
cout<<"NO";
return 0 ; }