Дополнен 5 месяцев назад
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
int main()
{
int k,m,n2;
string n;
cin >> k;
cin.get();
getline(cin,n);
cin >> m;
while (n.find(" ") != string::npos)
{
n.replace(n.find(" "),1,"");
}
n2 = stoll(n);
if(n2 % m == 0)
cout << "YES" << endl;
else
cout << "NO" << endl;
return 0;
}