#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"
//---------------------------


int main(){
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);



  long long sum=0,n,a;cin >> n >> a;
  REP(i,n){
    long long b;cin >> b;
    sum += b;
  }
  cout << (sum == n * a ? "YES" : "NO") << endl;
  

  return 0;
}