Untitled

mail@pastecode.io avatar
unknown
plain_text
5 months ago
296 B
4
Indexable
#include <iostream>

using namespace std;
int n, k;
int a[100005];
int tong = 0;
int main()
{
    cin >> n >> k;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        tong += a[i];
    }
    
    if(tong % k == 0 && n % k == 0) cout << "YES";
    else cout << "NO";

}
Leave a Comment