/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=4e14;
	while(id<=1e16)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=4e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
unordered_map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=4e14;
	while(id<=1e16)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=4e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=3e14;
	while(id<=8e14)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=3e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
unordered_map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=3e14;
	while(id<=8e14)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=3e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX]={0};
map<long long int, long long int>bit;
void update(long long int id, long long int z)
{
	id+=4e14;
	while(id<=1e16)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=4e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i],1LL);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

long long int seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline long long int rnd(long long int l=0,long long int r=0xFFFFFFFFFFFFFFFL)
{return uniform_int_distribution<long long int>(l,r)(rng);}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX]={0};
map<long long int, long long int>bit;
void update(long long int id, long long int z)
{
	id+=4e14;
	while(id<=1e16)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=4e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i],1LL);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=3e14;
	while(id<=7e14)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=3e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=3e14;
	while(id<=8e14)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=3e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


/**************************************************************
	When you are inspired by passion
	and you want to live for the current moment

	When your every thought and action
	has the power to become the story of your future

	When difficulties stand to demolish your Glory
	Just remember that Life is a 'Golden adverse Story'

	Withstand it to acheive your passion and dreams
	more amazingly more easily.

	Why then? When writing the story of your Life
	You want to Let someone else hold your pen

		huzaifa242 copyright

**************************************************************/
#pragma warning(disable:4996)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize ("-ffloat-store")
#include <bits/stdc++.h>
using namespace std;
#define MAX 200005
#define x first
#define y second

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &a)
{return out<<"("<<a.x<<" , "<<a.y<<")";}

template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a)
{out<<"[";for(const auto &i:a)out<<i<<" , ";return out<<"]";}

template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a)
{out<<"{";for(const auto &i:a)out<<i<<" , ";return out<<"}";}

template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a)
{out<<"<";for(const auto &i:a)out<<i<<" , ";return out<<">";}

template<typename T, size_t N>
typename enable_if<!is_same<typename remove_cv<T>::type, char>::value,
ostream&>::type operator<<(ostream& out, T(&a)[N])
{out<<'[';for(size_t i=0;i<N;++i)out<<a[i]<<" , ";out << ']';return out;}

long long int n,t,a[MAX];
map<long long int, long long int>bit;
void update(long long int id, long long int z=1LL)
{
	id+=4e14;
	while(id<=1e15)
	{
		bit[id]= bit[id] +z;
		id+=(id & (-id));
	}
}
long long int query(long long int id)
{
	long long int ans=0;
	id+=4e14;
	while(id>0)
	{
		ans= ans + bit[id];
		id-=(id & (-id));
	}
	return ans;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	int i;
	long long int ans=0;
	cin>>n>>t;
	for(i=1;i<=n;i++)
	{
		cin>>a[i];
		a[i]+=a[i-1];
	}
	for(i=n;i>=0;i--)
	{
		ans+=query(a[i]+t-1);
		update(a[i]);
	}
	cout<<ans;
	return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<long long int, null_type,less<long long int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define ull unsigned long long int
#define mod (ll)1e9+7
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppl pair<ll, ll>
#define loop(i,s,n) for(int i=s ; i<n ; i++)
#define loopl(i,s,n) for(ll i=s ; i<n ; i++)
#define loopr(i,e,s) for(int i=e; i>=s ; i--)
#define speedUp ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
ordered_set s,scur;
void doit()
{
    // ab_gupta
        ll n,t;
        cin>>n>>t;
        ll a[n+1];a[0]=0;
        ll ans=0;
        loopl(i,1,n+1)
        {
            cin>>a[i];
            a[i]+=a[i-1];
            s.insert(a[i]);
        }
        loopl(i,1,n+1)
        {
            ans+=s.order_of_key(t+a[i-1])-scur.order_of_key(t+a[i-1]);
            scur.insert(a[i]);
        }
        cout<<ans<<"\n";
}
int main()
{
    speedUp;
    doit();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <cassert>
using namespace std;
using namespace __gnu_pbds;
typedef tree<long long int, null_type, less_equal<long long int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set; //less_equal
#define ll long long int
#define ull unsigned long long int
#define mod (ll)1e9+7
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppl pair<ll, ll>
#define loop(i,s,n) for(int i=s ; i<n ; i++)
#define loopl(i,s,n) for(ll i=s ; i<n ; i++)
#define loopr(i,e,s) for(int i=e; i>=s ; i--)
#define speedUp ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
ordered_set s,scur;
void doit()
{
    // ab_gupta
        ll n,t;
        cin>>n>>t;
        ll a[n+1];a[0]=0;
        ll ans=0;
        loopl(i,1,n+1)
        {
            cin>>a[i];
            a[i]+=a[i-1];
            s.insert(a[i]);
        }
        loopl(i,1,n+1)
        {
            ans+=s.order_of_key(t+a[i-1])-scur.order_of_key(t+a[i-1]);
            scur.insert(a[i]);
        }
        cout<<ans<<"\n";
}
int main()
{
    speedUp;
    doit();
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define mod (ll)1e9+7
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppl pair<ll, ll>
#define loop(i,s,n) for(int i=s ; i<n ; i++)
#define loopl(i,s,n) for(ll i=s ; i<n ; i++)
#define loopr(i,e,s) for(int i=e; i>=s ; i--)
#define speedUp ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

void doit()
{
    // ab_gupta
        ll n,t;
        cin>>n>>t;
        ll a[n+1];
        cin>>a[1];
        loopl(i,2,n+1)
        {
            cin>>a[i];
            a[i]=a[i]+a[i-1];
        }
        a[0]=0;
        ll count=0;
        loopl(i,0,n+1)
            loopl(j,i+1,n+1)
            if((a[j]-a[i]) < t){
                count++;
                //cout<<j<<","<<i<<" --> \t"<<(a[j]-a[i])<<"\n";
            }
        cout<<count<<"\n";
}
int main()
{
    speedUp;
    doit();
    return 0;
}


#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace std;
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long int
#define ull unsigned long long int
#define mod (ll)1e9+7
#define pb push_back
#define mp make_pair
#define pp pair<int, int>
#define ppl pair<ll, ll>
#define loop(i,s,n) for(int i=s ; i<n ; i++)
#define loopl(i,s,n) for(ll i=s ; i<n ; i++)
#define loopr(i,e,s) for(int i=e; i>=s ; i--)
#define speedUp ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
ordered_set s,scur;
void doit()
{
    // ab_gupta
        ll n,t;
        cin>>n>>t;
        ll a[n+1];a[0]=0;
        ll ans=0;
        loopl(i,1,n+1)
        {
            cin>>a[i];
            a[i]+=a[i-1];
            s.insert(a[i]);
        }
        loopl(i,1,n+1)
        {
            ans+=s.order_of_key(t+a[i-1])-scur.order_of_key(t+a[i-1]);
            scur.insert(a[i]);
        }
        cout<<ans<<"\n";
}
int main()
{
    speedUp;
    doit();
    return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int i,j,k,l,n,m,x,flag=0;
	cin>>n>>m;
	vector<long long int> arr;
	for(i=0;i<n;i++)
	{
		cin>>x;
		arr.push_back(x);
	}

	if(n>=m)
		cout<<"YES"<<endl;

	else if(arr[0]%m==0)
		cout<<"YES"<<endl;

	else
	{
		//par[arr[0]%m]=1;
		m=min(n,m);
		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+arr[i])%m]=1;
				}
			}
			newpar[arr[i]%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;

	}
	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector<long long int > arr;

	for(i=0;i<n;i++)
	{
		cin>>x;
		y=x%m;
		arr.push_back(y);
	}
	if(n>m)
		cout<<"YES"<<endl;

	else{
		vector<long long int > parent(m+1,-1),newparent(m+1,-1);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}
			if(parent[0]==1)
		break;

		}
		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;
		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

if(parent[0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector<long long int > arr(n+1);

	for(i=0;i<n;i++)
	{

		arr[i]=x;

	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
	for(i=0;i<n;i++)
	{

		arr[i]=arr[i]%m;

	}

		vector<long long int > parent(m+1,-1),newparent(m+1,-1);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}
			if(parent[0]==1)
		break;

		}
		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;
		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

if(parent[0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);

	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
		bool parent[n+1];
		bool newparent[n+1];
		for(i=0;i<n;i++)
		{
			parent[i]=false;
			newparent[i]=false;
			arr[i]=arr[i]%m;
		}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==true)
			{
				newparent[(j+arr[i])%m]=true;
			}
			if(parent[0]==true)
			break;

		}

		if(parent[0]==true)
		break;
		newparent[arr[i]]=true;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==true)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int i,j,k,l,n,m,flag=0;
	long long int x;
	scanf("%d %d",&n,&m);
		if(n>=m)
		{
			for(i=0;i<n;i++)
		scanf("%I64d",&x)
				printf("YES\n");
		}

	else
	{
		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			scanf("%I64d",&x);
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+x)%m]=1;
				}
			}
			newpar[x%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);

	for(i=0;i<n;i++)
	{
		cin>>x;
		arr[i]=x;
	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
		for(i=0;i<n;i++)
		{

			arr[i]=arr[i]%m;
		}

	vector<int > parent(m+1,-1);
	vector<int > parent(m+1,-1);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}
			if(parent[0]==1)
			break;

		}

		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==1)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;

	cin>>n>>m;
	int chk[m+1];
	vector<long long int > arr;

	for(i=0;i<=m;i++)
		chk[i]=0;
	for(i=0;i<n;i++)
	{
		cin>>x;
		y=x%m;
		arr.push_back(y);
		chk[y]=1;
	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(chk[j]==1)
			chk[(j+arr[i])%m]=1;
		}
	}

if(chk[0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;

	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector<long long int > arr;
	vector<long long int > parent(m+1,-1),newparent(m+1,-1);

	for(i=0;i<n;i++)
	{
		cin>>x;
		y=x%m;
		arr.push_back(y);
	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}

		}
		newparent[arr[i]]=1;
		parent=newparent;

	}

if(parent[0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);
	bool parent[n+1];
		bool newparent[n+1];

	for(i=0;i<n;i++)
	{
		cin>>arr[i];
	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{

		for(i=0;i<n;i++)
		{
			parent[i]=false;
			newparent[i]=false;
			arr[i]=arr[i]%m;
		}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==true)
			{
				newparent[(j+arr[i])%m]=true;
			}
			if(parent[0]==true)
			break;

		}

		if(parent[0]==true)
		break;
		newparent[arr[i]]=true;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==true)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector<long long int > arr;
	vector<long long int > parent(m+1,-1),newparent(m+1,-1);

	for(i=0;i<n;i++)
	{
		cin>>x;
		y=x%m;
		arr.push_back(y);
	}
	n = min(n, m);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}

		}
		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;
		parent=newparent;

	}

if(parent[0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;

	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int i,j,k,l,n,m,x,flag=0;
	cin>>n>>m;

		if(n>=m)
		{
			for(i=0;i<n;i++)
			cin>>x;

			cout<<"YES"<<endl;
		}

	else
	{

		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			cin>>x;
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+x)%m]=1;
				}
			}
			newpar[x%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;

	}
	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);

	for(i=0;i<n;i++)
	{
		cin>>x;
		cin>>arr[i];

	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
		bool parent[n+1];
		bool newparent[n+1];
		for(i=0;i<n;i++)
		{
			parent[i]=false;
			newparent[i]=false;
			arr[i]=arr[i]%m;
		}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==true)
			{
				newparent[(j+arr[i])%m]=true;
			}
			if(parent[0]==true)
			break;

		}

		if(parent[0]==true)
		break;
		newparent[arr[i]]=true;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==true)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int i,j,k,l,n,m,flag=0;
	long long int x;
	scanf("%d %d",&n,&m);
		if(n>=m)
		{
			for(i=0;i<n;i++)
		scanf("%lld",&x);
				printf("YES\n");
		}

	else
	{
		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			scanf("%lld",&x);
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+x)%m]=1;
				}
			}
			newpar[x%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int i,j,k,l,n,m,flag=0;
	long long int x;
	scanf("%d %d",&n,&m);
		if(n>=m)
		{
			for(i=0;i<n;i++)
			cin>>x;
				printf("YES\n");
		}

	else
	{
		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			cin>>x;
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+x)%m]=1;
				}
			}
			newpar[x%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;

	cin>>n>>m;
	int chk[n+1][m+1];
	vector<long long int > arr;
	for(i=0;i<=n;i++)
	{
		for(j=0;j<=m;j++)
		chk[i][j]=0;
	}
	for(i=0;i<n;i++)
	{
		cin>>x;
		y=x%m;
		arr.push_back(y);

	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(chk[i][j]==1)
			chk[i+1][(j+arr[i])%m]=1;

		}
		chk[i+1][(arr[i])%m]=1;
	}

if(chk[n][0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;

	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int i,j,k,l,n,m,flag=0;
	long long int x;
	scanf("%d %d",n,m);
		if(n>=m)
		{
			for(i=0;i<n;i++)
			cin>>x;
				printf("YES\n");
		}

	else
	{
		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			cin>>x;
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+x)%m]=1;
				}
			}
			newpar[x%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		printf("YES\n");
		else
		printf("NO\n");
	}
	return 0;
}


using namespace std;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int i,j,k,l,n,m,x,flag=0;
	cin>>n>>m;
	vector<long long int> arr;
	for(i=0;i<n;i++)
	{
		cin>>x;
		arr.push_back(x);
	}

	if(n>=m)
		cout<<"YES"<<endl;

	else if(arr[0]%m==0)
		cout<<"YES"<<endl;

	else
	{
		//par[arr[0]%m]=1;

		vector<long long int>  par(m+1,0),newpar(m+1,0);
		for(i=0;i<n;i++)
		{
			for(j=0;j<m;j++)
			{
				if(par[j]==1)
				{
					newpar[(j+arr[i])%m]=1;
				}
			}
			newpar[arr[i]%m]=1;
			par=newpar;
			if(par[0]==1)
			{
				flag=1;
				break;
			}
		}
		if(flag==1)
		cout<<"YES"<<endl;
		else
			cout<<"NO"<<endl;

	}
	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);

	for(i=0;i<n;i++)
	{
		cin>>arr[i];

	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
		for(i=0;i<n;i++)
		{

			arr[i]=arr[i]%m;
		}

	vector<bool > parent(m+1,false);
	vector<bool > newparent(m+1,false);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==true)
			{
				newparent[(j+arr[i])%m]=true;
			}
			if(parent[0]==true)
			break;

		}

		if(parent[0]==true)
		break;
		newparent[arr[i]]=true;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==true)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);

	for(i=0;i<n;i++)
	{
		cin>>x;
		arr[i]=x;
	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
		for(i=0;i<n;i++)
		{

			arr[i]=arr[i]%m;
		}

	vector<int > parent(m+1,-1),newparent(m+1,-1);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}
			if(parent[0]==1)
			break;

		}

		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==1)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector< int > arr(n+1);

	for(i=0;i<n;i++)
	{
		cin>>arr[i];

	}

	if(n>m)
		cout<<"YES"<<endl;

	else
	{
		for(i=0;i<n;i++)
		{

			arr[i]=arr[i]%m;
		}

	vector<int > parent(m+1,-1);
	vector<int > newparent(m+1,-1);
	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}
			if(parent[0]==1)
			break;

		}

		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;

		for(j=0;j<m;j++)
			parent[j]=newparent[j];

	}

	if(parent[0]==1)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
}

	return 0;
}


using namespace std;
#include <iostream>
#include <fstream>
#include <sstream>

#include <vector>
#include <set>
#include <bitset>
#include <map>
#include <deque>
#include <string>

#include <algorithm>
#include <numeric>

#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vector>
#include <iostream>
int main()
{
	long long int x,n,i,j,k,cnt=0,y,ans,m;
	cin>>n>>m;
	vector<long long int > arr;
	vector<long long int > parent(m+1,-1),newparent(m+1,-1);

	for(i=0;i<n;i++)
	{
		cin>>x;
		y=x%m;
		arr.push_back(y);
	}

	for(i=0;i<n;i++)
	{
		for(j=0;j<m;j++)
		{
			if(parent[j]==1)
			{
				newparent[(j+arr[i])%m]=1;
			}

		}
		if(parent[0]==1)
		break;
		newparent[arr[i]]=1;
		parent=newparent;

	}

if(parent[0]==1)
	cout<<"YES"<<endl;
else
	cout<<"NO"<<endl;

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005];
map<int, int> mp, mp2;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
		mp2[pref[i]] = i;
		//printf("prefix %d: %d\n", i, pref[i]);
	}
	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
		//printf("prefix %d: %d\n", i, pref[i]);
	}

	for (int i=1; i<=2*n-1; i++){
		if (i <= n){
			if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] != i)){
				printf("YES\n");
				return 0;
			}
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005];
map<int, int> mp;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
	}
	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
	}

	for (int i=1; i<=2*n-1; i++){
		if (arr[(i>n)?i-n:i] == 0 || pref[(i>n)?i-n:i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005];
map<int, int> mp, mp2;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
		mp2[pref[i]] = i;
	}
	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
	}

	for (int i=1; i<=2*n-1; i++){
		if (i <= n){
			if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
				printf("YES\n");
				return 0;
			}
		}
		else {
			if (mp2.count(pref[i]) && mp2[pref[i]] > i - n){
				printf("YES\n");
				return 0;
			}
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[10000005], pref[10000005];
map<int, int> mp;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
	}
	for (int i=1; i<=n; i++){
		if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005], memo[1005][1005];
map<int, int> mp, mp2;

bool dp(int pos, int r){
	if (pos > n){
		if (r == 0) return 1;
		else return 0;
	}
	if (memo[pos][r] != -1) return memo[pos][r];
	return memo[pos][r] = dp(pos+1, (r+arr[pos])%m) | dp(pos+1, r);
}

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
		mp2[pref[i]] = i;
	}

	if (n <= m){
		memset(memo, -1, sizeof(memo));
		if (dp(1, m)){
			printf("YES\n");
		}
		else printf("NO\n");
		return 0;
	}

	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
	}

	for (int i=1; i<=2*n-1; i++){
		if (i <= n){
			if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
				printf("YES\n");
				return 0;
			}
		}
		else {
			if (mp2.count(pref[i]) && mp2[pref[i]] > i - n){
				printf("YES\n");
				return 0;
			}
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[10000005], pref[10000005];
map<int, int> mp;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		mp[pref[i]] = i;
	}
	for (int i=1; i<=n; i++){
		if (pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] != i)){
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005];
map<int, int> mp, mp2;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
		mp2[pref[i]] = i;
		//printf("prefix %d: %d\n", i, pref[i]);
	}
	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
		//printf("prefix %d: %d\n", i, pref[i]);
	}

	for (int i=1; i<=2*n-1; i++){
		if (i <= n){
			if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
				printf("YES\n");
				return 0;
			}
		}
		else {
			if (pref[i] == 0 || mp2.count(pref[i]) && mp2[pref[i]] > i - n){
				printf("YES\n");
				return 0;
			}
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005];
map<int, int> mp, mp2;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
		mp2[pref[i]] = i;
	}
	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
	}

	for (int i=1; i<=2*n-1; i++){
		if (i >= 1 && i <=n){
			if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
				printf("YES\n");
				return 0;
			}
		}
		else {
			if (mp.count(pref[i]) && mp2[pref[i]] >= i - n){
				printf("YES\n");
				return 0;
			}
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[1000005], pref[1000005];
map<int, int> mp, mp2;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		if (!mp.count(pref[i])){
			mp[pref[i]] = i;
		}
		mp2[pref[i]] = i;
	}
	for (int i=n+1; i<=2*n; i++){
		pref[i] = pref[i-1] + arr[i%n];
		pref[i] %= m;
	}

	for (int i=1; i<=2*n; i++){
		if (i <= n){
			if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
				printf("YES\n");
				return 0;
			}
		}
		else {
			if (mp2.count(pref[i]) && mp2[pref[i]] >= i - n){
				printf("YES\n");
				return 0;
			}
		}
	}
	printf("NO\n");
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int n, m, arr[10000005], pref[10000005];
map<int, int> mp;

int main(){
	scanf("%d %d", &n, &m);
	pref[0] = 0;
	for (int i=1; i<=n; i++){
		scanf("%d", &arr[i]);
		arr[i] %= m;
		pref[i] = pref[i-1] + arr[i];
		pref[i] %= m;
		mp[pref[i]] = i;
	}
	for (int i=1; i<=n; i++){
		if (arr[i] == 0 || pref[i] == 0 || (mp.count(pref[i]) && mp[pref[i]] < i)){
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 2020;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    if(n >= m) {
        for(int i = 0; i < n; ++i)
            scanf("%d", &m);
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][(a[i] % m)] = 1;
        else {
            dp[i][(a[i] % m)] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1e6 + 6;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    if(n >= m) {
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][a[i] % m] = 1;
        else {
            dp[i][a[i] % m] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1e6 + 6;
int a[MAXN], m, x = 0, n, cur = 0;
bool flag = false;
void dfs(int x, int cur)
{
    if(flag) return;
    if(x % m == 0 && x) {
        flag = true;
        return;
    }
    if(cur == n) return;
    dfs(x + a[cur], cur + 1);
    dfs(x, cur + 1);
}
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    for(int i = 0; i < n; ++i)
        if(a[i] == 0) {
            printf("YES\n");
            return 0;
        }
    dfs(x, cur);
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1e6 + 6;
int a[MAXN], m, x = 0, n, cur = 0;
bool flag = false;
void dfs(int x, int cur)
{
    if(flag) return;
    if(x % m == 0 && x) {
        flag = true;
        return;
    }
    if(cur == n) return;
    dfs(x + a[cur], cur + 1);
    dfs(x, cur + 1);
}
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    dfs(x, cur);
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1e3 + 5;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    if(n >= m) {
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][a[i] % m] = 1;
        else {
            dp[i][a[i] % m] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1010;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    if(n >= m) {
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][(a[i] % m)] = 1;
        else {
            dp[i][(a[i] % m)] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1010;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    if(n >= m) {
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][a[i] % m] = 1;
        else {
            dp[i][a[i] % m] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1e5 + 6;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    if(n >= m) {
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][a[i] % m] = 1;
        else {
            dp[i][a[i] % m] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 1e6 + 6;
typedef long long ll;
ll a[MAXN], m, x = 0;
int n, cur = 0;
bool flag = false;
void dfs(ll x, int cur)
{
    if(flag) return;
    if(x % m == 0 && x) {
        flag = true;
        return;
    }
    if(cur == n) return;
    dfs(x + a[cur], cur + 1);
    dfs(x, cur + 1);
}
int main(int argc, char const *argv[])
{
    scanf("%d%I64d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%I64d", &a[i]);
    dfs(x, cur);
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 2020;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
    scanf("%d%d", &n, &m);
    for(int i = 0; i < n; ++i)
        scanf("%d", &a[i]);
    if(n >= m) {
        printf("YES\n");
        return 0;
    }
    for(int i = 0; i < n; ++i) {
        if(!i) dp[0][(a[i] % m)] = 1;
        else {
            dp[i][(a[i] % m)] = 1;
            for(int j = 0; j < m; ++j)
                if(dp[i - 1][j]) {
                    dp[i][(j + a[i]) % m] = 1;
                    dp[i][j] = dp[i - 1][j];
                }
        }
    }
    for(int i = 0; i < n; ++i)
        if(dp[i][0]) {
            flag = true;
            break;
        }
    if(flag) printf("YES\n");
    else printf("NO\n");
    return 0;
}


#include "iostream"
#include "cstdio"
#include "cstring"
#include "algorithm"
using namespace std;
const int MAXN = 10100;
int a[MAXN], dp[MAXN][MAXN], n, m;
bool flag;
int main(int argc, char const *argv[])
{
	scanf("%d%d", &n, &m);
	for(int i = 0; i < n; ++i)
		scanf("%d", &a[i]);
	if(n >= m) {
		printf("YES\n");
		return 0;
	}
	for(int i = 0; i < n; ++i) {
		if(!i) dp[0][(a[i] % m)] = 1;
		else {
			dp[i][(a[i] % m)] = 1;
			for(int j = 0; j < m; ++j)
				if(dp[i - 1][j]) {
					dp[i][(j + a[i]) % m] = 1;
					dp[i][j] = dp[i - 1][j];
				}
		}
	}
	for(int i = 0; i < n; ++i)
		if(dp[i][0]) {
			flag = true;
			break;
		}
	if(flag) printf("YES\n");
	else printf("NO\n");
	return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int a[N];
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           dp[i%2][x%k]=1;
           for(j=0;j<k;j++)
           {
              dp[i%2][j]=dp[(i-1)%2][j];
              if(dp[(i-1)%2][j])
              {
             //   cout<<i<<j<<x<<endl;
                dp[i%2][(j+x)%k]=1;
                //cout<<(j+x)%k<<endl;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int a[N];
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           for(j=0;j<k;j++) dp[i%2][j]=dp[(i-1)%2][j];
           for(j=0;j<k;j++)
              if(dp[(i-1)%2][j])
                  dp[i%2][(j+x)%k]=1;
           dp[i%2][x%k]=1;
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int a[N];
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
     //  for(i=0;i<n;i++) scanf("%d",&a[i]);
       scanf("%d",&x);
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           dp[(i-1)%2][0]=1;
           for(j=0;j<k;j++) dp[i%2][j]=0;
           for(j=0;j<k;j++)
           {
              if(dp[(i-1)%2][j])
              {
             //   cout<<i<<j<<x<<endl;
                if(j)
                dp[i%2][j]=1;
                dp[i%2][(j+x)%k]=1;
                //cout<<(j+x)%k<<endl;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int a[N];
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       for(i=0;i<n;i++) scanf("%d",&a[i]);
       if(n>k) {cout<<"YES"<<endl;continue;}
       memset(dp,0,sizeof(dp));
       x=a[0];
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           x=a[i];
           for(j=0;j<k;j++) dp[i%2][j]=dp[(i-1)%2][j];
           for(j=0;j<k;j++)
              if(dp[(i-1)%2][j])
                  dp[i%2][(j+x)%k]=1;
           dp[i%2][x%k]=1;
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
      // if(x!=0)
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           //if(x!=0)
           dp[(i-1)%2][0]=1;
           for(j=0;j<k;j++) dp[i%2][j]=0;
           for(j=0;j<k;j++)
           {
              if(dp[(i-1)%2][j])
              {
                dp[i%2][j]=1;
                dp[i%2][(j+x)%k]=1;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       if(x!=0)
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           if(x!=0)
           dp[(i-1)%2][0]=1;
           for(j=0;j<k;j++) dp[i%2][j]=0;
           for(j=0;j<k;j++)
           {
              if(dp[(i-1)%2][j])
              {
             //   cout<<i<<j<<x<<endl;
                if(j)
                dp[i%2][j]=1;
                dp[i%2][(j+x)%k]=1;
                //cout<<(j+x)%k<<endl;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int dp[2][1001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       if(x!=0)
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           if(x!=0)
           dp[(i-1)%2][0]=1;
           for(j=0;j<k;j++) dp[i%2][j]=0;
           for(j=0;j<k;j++)
           {
              if(dp[(i-1)%2][j])
              {
                dp[i%2][j]=1;
               // cout<<i<<j<<x<<endl;
                dp[i%2][(j+x)%k]=1;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int a[N];
int dp[2][2001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           for(j=0;j<k;j++)
           {
              dp[i%2][j]=dp[(i-1)%2][j];
              if(dp[(i-1)%2][j])
              {
               // cout<<i<<j<<x<<endl;
                dp[i%2][(j+x)%k]=1;
              //  cout<<(j+x)%k<<endl;
              }
           }
           dp[i%2][x%k]=1;
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int dp[2][1001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       if(x!=0)
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           if(x!=0)
           dp[(i-1)%2][0]=1;
           for(j=0;j<k;j++)
           {
              if(dp[(i-1)%2][j])
              {
                dp[(i)%2][(j+x)%k]=1;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <cstdio>
#include <queue>
#include <cstring>
#include<cmath>
#include<vector>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
int a[1005];
int main()
{
  int n,x,i,j;
  while(~scanf("%d",&n))
  {
      memset(a,1,sizeof(a));
      int ans=0;
      for(i=2;i<=n;i++)
      {
           for(j=i-1;j>1;j--)
           {
             if(a[j]&&i%j==0)
             {
               // cout<<i<<j<<endl;
                if(j%(i/j)!=0)
                {
                  a[i]=0;
                }
                break;
             }
           }
           if(a[i])
            ans++;
      }
      cout<<ans<<endl;
      int p=1;
      for(i=2;i<=n;i++)
      {
         if(a[i])
         {
           if(p)
           {
             printf("%d",i);p=0;
           }
           else printf(" %d",i);
         }
      }
      if(ans)
      printf("\n");
  }
  return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
int a[N];
bool dp[N][1001];
int main()
{
   int t,n,i,j,k;
   while(~scanf("%d%d",&n,&k))
   {
       for(i=0;i<n;i++)
          scanf("%d",&a[i]);
       memset(dp,0,sizeof(dp));
       dp[0][(a[0]%k+k)%k]=1;
       for(i=1;i<n;i++)
           for(j=0;j<k;j++)
           {
              a[i]=abs(a[i]);
              if(dp[i-1][j])
                dp[i][(j+a[i])%k]=dp[i][((j-a[i])%k+k)%k]=1;

           }
       if(dp[n-1][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


#include <iostream>
#include <cstring>
#include <cmath>
#include <cstdio>
#include<cstdio>
#include <cstdlib>
using namespace std;
const int N=1000005;
bool dp[2][1001];
int main()
{
   int t,n,i,j,k,x;
   while(~scanf("%d%d",&n,&k))
   {
       memset(dp,0,sizeof(dp));
       scanf("%d",&x);
       dp[0][x%k]=1;
       for(i=1;i<n;i++)
       {
           scanf("%d",&x);
           dp[(i-1)%2][0]=1;
           for(j=0;j<k;j++)
           {
              if(dp[(i-1)%2][j])
              {
                 // cout<<i<<j<<x<<endl;
                dp[(i)%2][(j+x)%k]=1;
              }
           }
       }
       if(dp[(i-1)%2][0])
          cout<<"YES"<<endl;
       else
          cout<<"NO"<<endl;
   }
   return 0;
}


//2016-05-02 09:06:42.460000
#include<algorithm>
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;
#define NN 100010
int a[NN],vst[NN];
int main(){
//	freopen("b.in","r",stdin);
	int n,m,i,j;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++) {scanf("%d",a+i);a[i]%=m;}
	if(n>m) puts("YES");
	else{
		memset(vst,0,sizeof(vst));
		vst[a[0]]=1;
		for(i=1;i<n;i++){
			for(j=0;j<m;j++){
				if(vst[j]) vst[(j+a[i])%m]=1;
			}
			vst[a[i]]=1;
		}
		if(vst[0]) puts("YES");
		else puts("NO");
	}
}


//2016-05-02 08:57:23.570000
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <memory.h>
#define NN 1000010

using namespace std;

int a[NN],vst[1100];

int main (){
	int N,i,M,j;
	scanf("%d %d",&N,&M);
	memset(vst,0,sizeof(vst));
	for(i=0; i<N; i++){
		scanf("%d",a+i);
		a[i]%=M;
	}
	vst[0]=1;
	for(i=0; i<N; i++){
		for(j=M-1; j>=0; j--){
			if(vst[j]){
				int t=(j+a[i])%M;
				if(t==0) t=M;
				vst[t]=1;
			}
		}
	}
	if(vst[M]) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 10:36:01.220000
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <set>
#include <memory.h>
#define NN 1000010

using namespace std;

int a[NN],vst[1100];
set <int> s;

int main (){
	int N,i,M,j;
	scanf("%d %d",&N,&M);
	memset(vst,0,sizeof(vst));
	for(i=0; i<N; i++){
		scanf("%d",a+i);
		a[i]%=M;
	}
	if(N>M) puts("YES");
	else {
		for(i=0; i<N; i++){
			for(j=M-1; j>=0; j--){
				if(vst[j] || j==0){
					int t=(j+a[i])%M;
					if(!vst[t]) s.insert(t);
				}
			}
			while(!s.empty()){
				int t=*s.begin();
				vst[t]++;
				s.erase(t);
			}
		}
		if(vst[0]) puts("YES");
		else puts("NO");
	}
	return 0;
}


//2016-05-02 09:50:17.672000
#include<algorithm>
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;
#define NN 2010
int a[NN],vst[NN],vt[NN];
int main(){
//	freopen("b.in","r",stdin);
	int n,m,i,j,drag=0;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++) {scanf("%d",a+i);a[i]=a[i]%m;
		if(a[i]==0) drag=1;}
	if(n>m || drag==1) {puts("YES");return 0;}
		memset(vst,0,sizeof(vst));
		for(i=0;i<n;i++){
			memset(vt,0,sizeof(vt));
			for(j=0;j<m;j++){
				if(vst[j]) vt[(j+a[i])%m]=1;
			}
			for(j=0;j<m;j++)
				if(vt[j]) vst[j]=1;
			vst[a[i]%m]=1;
			if(vst[0]) break;
		}
		if(vst[0]) puts("YES");
		else puts("NO");
}


//2016-05-02 10:29:23.321000
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
#define NN 11111
#define MM 1111111

int a[MM], cnt[NN], vst[NN];
int main () {
//	freopen("B.in", "r", stdin);
//	freopen("out.out", "w", stdout);

	int N, M, i;
	scanf("%d %d", &N, &M);
	for (i=0; i<N; i++) {
		scanf("%d", &a[i]);
		a[i]%=M;
	}
	sort(a, a+N);
	int t=0;
	if(a[0]==0) {
		puts("YES");
		return 0;
	}
	t=1;
	memset(cnt, 0, sizeof(cnt));
	for (i=0; i<N; i++) {
		if(a[i]==t) cnt[t]++;
		else {
			i--;
			t++;
		}
	}
	memset(vst, 0, sizeof(vst));

	for (i=1; i<M; i++) {
		if(cnt[i]==0) continue;
		for (int j=1; j<=cnt[i]; j++) {
			vst[((long long)i*j)%M]=1;
			for (int k=1; k<M; k++) {
				if(vst[k]==1) vst[((long long)i*j+k)%M]=1;
			}
		}
	}
	if(vst[0]==1) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 09:19:47.061000
#include<algorithm>
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;
#define NN 100010
int a[NN],vst[NN],vt[NN];
int main(){
//	freopen("b.in","r",stdin);
	int n,m,i,j;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++) {scanf("%d",a+i);a[i]%=m;}
	if(n>m) puts("YES");
	else{
		memset(vst,0,sizeof(vst));
		for(i=0;i<n;i++){
			memset(vt,0,sizeof(vt));
			for(j=0;j<m;j++){
				if(vst[j]) vt[(j+a[i])%m]=1;
			}
			for(j=0;j<m;j++)
				if(vt[j]) vst[j]=1;
			vst[a[i]]=1;
		}
		if(vst[0]) puts("YES");
		else puts("NO");
	}
}


//2016-05-02 10:14:21.818000
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
#define NN 11111

int a[NN], cnt[NN], vst[NN];
int main () {
//	freopen("B.in", "r", stdin);
//	freopen("out.out", "w", stdout);

	int N, M, i, sum=0;
	scanf("%d %d", &N, &M);
	for (i=0; i<N; i++) {
		scanf("%d", &a[i]);
		a[i]%=M;
	}
	sort(a, a+N);
	int t=0;
	if(a[0]==0) {
		puts("YES");
		return 0;
	}
	t=1;
	memset(cnt, 0, sizeof(cnt));
	for (i=0; i<N; i++) {
		if(a[i]==t) cnt[t]++;
		else {
			i--;
			t++;
		}
	}

	for (i=1; i<M; i++) {
		if(cnt[i]==0) continue;
		for (int j=1; j<=cnt[i]; j++) {
			vst[i*j]=1;
			for (int k=1; k<M; k++) {
				if(vst[k]==1) vst[(i*j+k)%M]=1;
			}
		}
	}
	if(vst[0]==1) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 10:31:46.364000
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
#define NN 11111
#define MM 1111111

int a[MM], cnt[NN], vst[NN];
int main () {
//	freopen("B.in", "r", stdin);
//	freopen("out.out", "w", stdout);

	int N, M, i;
	scanf("%d %d", &N, &M);
	for (i=0; i<N; i++) {
		scanf("%d", &a[i]);
		a[i]%=M;
	}
	if(N>=M) {
		puts("YES");
		return 0;
	}
	sort(a, a+N);
	int t=0;
	if(a[0]==0) {
		puts("YES");
		return 0;
	}
	t=1;
	memset(cnt, 0, sizeof(cnt));
	for (i=0; i<N; i++) {
		if(a[i]==t) cnt[t]++;
		else {
			i--;
			t++;
		}
	}
	memset(vst, 0, sizeof(vst));

	for (i=1; i<M; i++) {
		if(cnt[i]==0) continue;
		for (int j=1; j<=cnt[i]; j++) {
			vst[((long long)i*j)%M]=1;
			for (int k=1; k<M; k++) {
				if(vst[k]==1) vst[((long long)i*j+k)%M]=1;
			}
		}
	}
	if(vst[0]==1) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 09:51:59.951000
#include<algorithm>
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;
#define NN 1010
int a[NN*NN],vst[NN],vt[NN];
int main(){
//	freopen("b.in","r",stdin);
	int n,m,i,j,drag=0;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++) {scanf("%d",a+i);a[i]=a[i]%m;
		if(a[i]==0) drag=1;}
	if(n>m || drag==1) {puts("YES");return 0;}
		memset(vst,0,sizeof(vst));
		for(i=0;i<n;i++){
			memset(vt,0,sizeof(vt));
			for(j=0;j<m;j++){
				if(vst[j]) vt[(j+a[i])%m]=1;
			}
			for(j=0;j<m;j++)
				if(vt[j]) vst[j]=1;
			vst[a[i]%m]=1;
			if(vst[0]) break;
		}
		if(vst[0]) puts("YES");
		else puts("NO");
}


//2016-05-02 09:15:41.427000
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <set>
#include <memory.h>
#define NN 1000010

using namespace std;

int a[NN],vst[1100];
set <int> s;

int main (){
	int N,i,M,j;
	scanf("%d %d",&N,&M);
	memset(vst,0,sizeof(vst));
	for(i=0; i<N; i++){
		scanf("%d",a+i);
		a[i]%=M;
		if(a[i]==0) a[i]=M;
	}
	vst[0]=1;
	for(i=0; i<N; i++){
		for(j=M-1; j>=0; j--){
			if(vst[j]){
				int t=(j+a[i])%M;
				if(t==0) t=M;
				s.insert(t);
			}
		}
		while(!s.empty()){
			int t=*s.begin();
			vst[t]=1;
			s.erase(t);
		}
	}
	if(vst[M]) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 10:21:42.074000
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <string.h>
using namespace std;
#define NN 11111

int a[NN], cnt[NN], vst[NN];
int main () {
//	freopen("B.in", "r", stdin);
//	freopen("out.out", "w", stdout);

	int N, M, i, sum=0;
	scanf("%d %d", &N, &M);
	for (i=0; i<N; i++) {
		scanf("%d", &a[i]);
		a[i]%=M;
	}
	sort(a, a+N);
	int t=0;
	if(a[0]==0) {
		puts("YES");
		return 0;
	}
	t=1;
	memset(cnt, 0, sizeof(cnt));
	for (i=0; i<N; i++) {
		if(a[i]==t) cnt[t]++;
		else {
			i--;
			t++;
		}
	}

	for (i=1; i<M; i++) {
		if(cnt[i]==0) continue;
		for (int j=1; j<=cnt[i]; j++) {
			vst[(i*j)%M]=1;
			for (int k=1; k<M; k++) {
				if(vst[k]==1) vst[(i*j+k)%M]=1;
			}
		}
	}
	if(vst[0]==1) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 09:03:39.019000
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <memory.h>
#define NN 1000010

using namespace std;

int a[NN],vst[1100];

int main (){
	int N,i,M,j;
	scanf("%d %d",&N,&M);
	memset(vst,0,sizeof(vst));
	for(i=0; i<N; i++){
		scanf("%d",a+i);
		a[i]%=M;
		if(a[i]==0) a[i]=M;
	}
	vst[0]=1;
	for(i=0; i<N; i++){
		for(j=M-1; j>=0; j--){
			if(vst[j]){
				int t=(j+a[i])%M;
				if(t==0) t=M;
				vst[t]=1;
			}
		}
	}
	if(vst[M]) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 09:18:07.628000
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <set>
#include <memory.h>
#define NN 1000010

using namespace std;

int a[NN],vst[1100];
set <int> s;

int main (){
	int N,i,M,j;
	scanf("%d %d",&N,&M);
	memset(vst,0,sizeof(vst));
	for(i=0; i<N; i++){
		scanf("%d",a+i);
		a[i]%=M;
		if(a[i]==0) a[i]=M;
	}
	vst[0]=1;
	for(i=0; i<N; i++){
		for(j=M-1; j>=0; j--){
			if(vst[j]){
				int t=(j+a[i])%M;
				if(t==0) t=M;
				if(!vst[t]) s.insert(t);
			}
		}
		while(!s.empty()){
			int t=*s.begin();
			vst[t]=1;
			s.erase(t);
		}
	}
	if(vst[M]) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 08:47:35.341000
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <memory.h>
#define NN 1000010

using namespace std;

int a[NN],vst[1100];

int main (){
	int N,i,M,j;
	scanf("%d %d",&N,&M);
	for(i=0; i<N; i++){
		scanf("%d",a+i);
		a[i]%=M;
		vst[a[i]]=1;
	}
	for(i=0; i<N; i++){
		for(j=M-1; j>=0; j--){
			if(vst[j]){
				vst[(j+a[i])%M]=1;
			}
		}
	}
	if(vst[0]) puts("YES");
	else puts("NO");
	return 0;
}


//2016-05-02 08:46:29.847000
#include<algorithm>
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;
#define NN 100010
int a[NN],vst[NN];
int main(){
//	freopen("b.in","r",stdin);
	int n,m,i,j;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++) {scanf("%d",a+i);a[i]%=m;}
	if(n>m) puts("YES");
	else{
		memset(vst,0,sizeof(vst));
		vst[a[0]]=1;
		for(i=1;i<n;i++){
			for(j=0;j<m;j++){
				if(vst[j]) vst[(j+a[i])%m]=1;
			}
		}
		if(vst[0]) puts("YES");
		else puts("NO");
	}
}


//2016-05-02 09:23:31.965000
#include<algorithm>
#include<stdio.h>
#include<memory.h>
#include<vector>
using namespace std;
#define NN 2010
int a[NN],vst[NN],vt[NN];
int main(){
//	freopen("b.in","r",stdin);
	int n,m,i,j;
	scanf("%d%d",&n,&m);
	for(i=0;i<n;i++) {scanf("%d",a+i);a[i]%=m;}
	if(n>m) puts("YES");
	else{
		memset(vst,0,sizeof(vst));
		for(i=0;i<n;i++){
			memset(vt,0,sizeof(vt));
			for(j=0;j<m;j++){
				if(vst[j]) vt[(j+a[i])%m]=1;
			}
			for(j=0;j<m;j++)
				if(vt[j]) vst[j]=1;
			vst[a[i]]=1;
		}
		if(vst[0]) puts("YES");
		else puts("NO");
	}
}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[1000010];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	if(n>=k){
		cout <<"YES" << endl;
		return 0;
	}
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<long long>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  long long sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				return 0;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
	}
			cout <<"NO" << endl;
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<int> s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<int>::iterator it;
		for(int i=1;i<n;++i){
			it=s.end();
			--it;
			for(;;){
			  int sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[1000010];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	if(n>=k){
		cout <<"YES" << endl;
		return 0;
	}
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<long long>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  long long sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<long long>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  long long sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<int>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  int sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[1000010];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<long long>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  long long sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[100010];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<long long>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  long long sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<long long > s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<long long>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  int sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		for(int i=0;i<n;++i){
			for(int j=k;j>=0;--j){
				if(m[i]==j){
					if(dp[j]==1){
						if(j+m[i]>k) continue;
						dp[j+m[i]]=1;
					}else{
						dp[j]=1;
					}
				}else{
					if(dp[j]==1){
						if(j+m[i]>k) continue;
						dp[j+m[i]]=1;
					}
				}
			}
		}
		if(dp[k]==1){
			cout <<"YES" << endl;
		}else{
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<int> s;
		s.insert(m[0]);
		set<int>::iterator it;
		for(int i=1;i<n;++i){
			it=s.end();
			--it;
			for(;;){
			  int sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<int> s;
		s.insert(m[0]);
		set<int>::iterator it;
		for(int i=1;i<n;++i){
			it=s.end();
			--it;
			for(;;){
			  int sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		for(int i=0;i<n;++i){
			for(int j=k;j>=0;--j){
				if(m[i]==j){
					if(dp[j]==1){
						if(j+m[i]>k) continue;
						dp[j+m[i]]=1;
					}else{
						dp[j]=1;
					}
				}else{
					if(dp[j]==1){
						if(j+m[i]>k) continue;
						dp[j+m[i]]=1;
					}
				}
			}
		}
		if(dp[k]==1 || dp[0]==1){
			cout <<"YES" << endl;
		}else{
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <vector>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <math.h>
#include <string.h>
#include <sstream>
#include <list>
#include <bitset>
#include <set>
#include <algorithm>
#include <cassert>
#define EPS 1e-7
#define N 1024010
using namespace std;
int dp[10000];
int n,k;
int m[10000];
int main(){
	//~ freopen("o1.txt", "r", stdin);
	//~ freopen("o1.txt", "w", stdout);
	cin >> n >> k;
	for(int i=0;i<n;++i){
		cin >> m[i];
	}
	if(n>=k){
		cout << "YES" << endl;
	}else{
		bool isfound=false;
		set<int> s;
		s.insert(m[0]);
		if(m[0]%k==0){
			cout <<"YES" << endl;
			return 0;
		}
		set<int>::iterator it;
		for(int i=1;i<n;++i){
			if(m[i]%k==0){
				cout << "YES" << endl;
				return 0;
			}
			it=s.end();
			--it;
			for(;;){
			  int sum=*it+m[i];
			  if(sum%k==0){
				cout <<"YES" << endl;
				isfound=true;
				break;
			  }
			  s.insert(sum);
			  if(it==s.begin()) break;
			  --it;
			}
			s.insert(m[i]);
		}
		if(!isfound){
			cout <<"NO" << endl;
		}
	}
	return 0;

}


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <iterator>
#include <map>
#include <cstring>

using namespace std;

#define READ() freopen("in.txt","r",stdin)
#define WRITE() freopen("out.txt","w",stdout)
#define sf(n) scanf("%d",&n)
#define lsf(n) scanf("%lld", &n)
#define pb(n) push_back(n)

#define debug(x,xString) cout << "value of " << xString<< "  : " << x << endl
#define debug() cout << "working!!" << endl;
#define MAX 10000007
#define MOD 1000000007

long long arr[1000010];
long long cum[1000010];

//long long dp[1010][1010];

bool foundAns = false;
int n;
int m;
void func(int i,int tot)
{
//    cout << tot << endl;

    if(tot%m == 0 && tot > 0)foundAns = true;
    if(foundAns)return;

    long long res1,res2;
    for(int ii = i;ii<n;ii++)
    {
        func(ii+1,(arr[ii]+tot));
    }
    return;
}

int main()
{
//    READ();
//    WRITE();

    cin >> n;

    cin >> m;

    for(int i=0;i<n;i++)
    {
        cin >> arr[i];

        if(i == 0)cum[i] = arr[i];
        else cum[i] = cum[i-1] + arr[i];
    }

    if(n > m) /// piegeionhole thrm
    {
        bool found = false;
        map <long long, int> mp;

        for(int i=0;i<n;i++)
        {
            if(mp[cum[i]%m] == 1)
            {
                found = true;
                break;
            }
            else mp[cum[i]%m]++;
        }
        if(found)cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    else if(n <= m) /// generate all subsequence
    {
//        memset(dp,-1,sizeof(dp));
        func(0,0);

        if(foundAns)cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <iterator>
#include <map>
#include <cstring>

using namespace std;

#define READ() freopen("in.txt","r",stdin)
#define WRITE() freopen("out.txt","w",stdout)
#define sf(n) scanf("%d",&n)
#define lsf(n) scanf("%lld", &n)
#define pb(n) push_back(n)

//#define debug(x,xString) cout << "value of " << xString<< "  : " << x << endl
//#define debug() cout << "working!!" << endl;
#define MAX 10000007
#define MOD 1000000007

int arr[1000010];

int n;
int m;
int dp[1010][1010][3];
bool foundAns = false;
int func(int i,int curTot,int fl)
{
//    cout << curTot << endl;
    if(foundAns)return 1;
    if(i>=n)
    {
        if(curTot == 0 && fl == 1)
        {
            foundAns = true;
            return 1;
        }
        else return 0;
    }

    if(dp[i][curTot][fl] != -1)return dp[i][curTot][fl];

    int res1 = func(i+1,(curTot+arr[i])%m,1);
    int res2 = func(i+1,(curTot)%m,fl);

    return dp[i][curTot][fl] = res1 || res2;
}

int main()
{
//    READ();
//    WRITE();

    cin >> n;
    cin >> m;

    for(int i=0;i<n;i++)
    {
        cin >> arr[i];
    }

    if(n > m)cout << "YES" << endl;

    else if(n <= m)
    {
        memset(dp,-1,sizeof(dp));
        func(0,0,0);

        if(foundAns)cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <iterator>
#include <map>
#include <cstring>

using namespace std;

#define READ() freopen("in.txt","r",stdin)
#define WRITE() freopen("out.txt","w",stdout)
#define sf(n) scanf("%d",&n)
#define lsf(n) scanf("%lld", &n)
#define pb(n) push_back(n)

#define debug(x,xString) cout << "value of " << xString<< "  : " << x << endl
#define debug() cout << "working!!" << endl;
#define MAX 10000007
#define MOD 1000000007

long long arr[1000010];
long long cum[1000010];

long long dp[1010][1010];

bool foundAns = false;
int n;
int m;
long long func(int i,long long tot)
{
//    cout << tot << endl;

    if(tot%m == 0 && i>0)foundAns = true;
    if(foundAns || i>=n)return tot;

    if(dp[i][tot%m] != -1)return dp[i][tot%m];

    long long res1=0,res2;
    for(int ii = i;ii<n;ii++)
    {
        res1 = func(ii+1,arr[ii]) + func(ii+1,arr[ii]+tot);
    }
    return dp[i][tot%m] = res1;
}

int main()
{
//    READ();
//    WRITE();

//    cin >> n;
    sf(n);
    sf(m);

//    cin >> m;

    bool found = false;
    map <long long, int> mp;
    for(int i=0;i<n;i++)
    {
//        cin >> arr[i];

        lsf(arr[i]);

        if(i == 0)cum[i] = arr[i]%m;
        else cum[i] = (cum[i-1] + arr[i])%m;

        if(mp[cum[i]] == 1)
        {
            found = true;
//                break;
        }
        else mp[cum[i]]++;
    }

    if(n > m) /// piegeionhole thrm
    {

        if(found)cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    else if(n <= m) /// generate all subsequence
    {
        memset(dp,-1,sizeof(dp));
        func(0,0);

        if(foundAns)cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}


#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <iterator>
#include <map>
#include <cstring>

using namespace std;

#define READ() freopen("in.txt","r",stdin)
#define WRITE() freopen("out.txt","w",stdout)
#define sf(n) scanf("%d",&n)
#define lsf(n) scanf("%lld", &n)
#define pb(n) push_back(n)

#define debug(x,xString) cout << "value of " << xString<< "  : " << x << endl
#define debug() cout << "working!!" << endl;
#define MAX 10000007
#define MOD 1000000007

long long arr[1000010];
long long cum[1000010];

long long dp[1010][1010];

bool foundAns = false;
int n;
int m;
long long func(int i,long long tot)
{
//    cout << tot << endl;

    if(tot%m == 0 && i>0 && arr[i] == 0)foundAns = true;
//    if(tot%m == 0 && tot == 0 )foundAns = true;
    if(foundAns || i>=n)return tot;

    if(dp[i][tot%m] != -1)return dp[i][tot%m];

    long long res1=0,res2;
    for(int ii = i;ii<n;ii++)
    {
        res1 = func(ii+1,tot) + func(ii+1,arr[ii]+tot);
    }
    return dp[i][tot%m] = res1;
}

int main()
{
//    READ();
//    WRITE();

//    cin >> n;
    sf(n);
    sf(m);

//    cin >> m;

    bool found = false;
    map <long long, int> mp;
    for(int i=0;i<n;i++)
    {
//        cin >> arr[i];

        lsf(arr[i]);

        if(i == 0)cum[i] = arr[i]%m;
        else cum[i] = (cum[i-1] + arr[i])%m;

        if(mp[cum[i]] == 1)
        {
            found = true;
//                break;
        }
        else mp[cum[i]]++;
    }

    if(n > m) /// piegeionhole thrm
    {

        if(found)cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    else if(n <= m) /// generate all subsequence
    {
        memset(dp,-1,sizeof(dp));
        func(1,arr[0]);

        if(foundAns)cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}