#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll MOD = 1000000007;

int main(){
	
	int n;
	cin>>n;
	
	vector<ll> lista(n+1);
	for(int i = 1; i<=n; i++){
		cin>>lista[i];
	}
	
	vector<vector<ll> > dp(n+1, vector<ll>(n+1, 0));
	
	for(int i = 1; i<=n; i++){
		dp[i][1] = 1;
	}
	
	for(int i = 2; i<=n; i++){
		vector<ll> resto(i, 0);
		ll sum = 0;
		for(int j = 1; j<=n; j++){
			sum = (sum + lista[j])%i;
			dp[j][i] = (dp[j][i] + resto[sum%i])%MOD;
			resto[sum%i] = (resto[sum%i] + dp[j][i-1])%MOD;
		}
	}
	
	ll res = 0;
	for(int i = 1; i<=n; i++){
		res = (res + dp[n][i])%MOD;
	}
	
	cout<<res<<"\n";
	
	return 0;
}

#include <bits/stdc++.h>
using ll=long long;
using ld=long double;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

ll p=998244353;

vector<ll> a(200100);
vector<ll> b(200100);

ll powk(ll k,ll n){
  ll ans=1,m=k;
  while(n){
    if(n%2) ans=ans*m%p;
    m=m*m%p; n/=2;
  }
  return ans;
}

void comb1(){
  a[0]=1;
  for(ll i=1;i<200100;i++) a[i]=a[i-1]*i%p;
  rep(i,200100) b[i]=powk(a[i],p-2);
  return;
}

ll comb(int n,int k){
  ll ans=a[n]*b[n-k]%p*b[k]%p;
  return ans;
}

int main(){
  comb1();
  ll n,m;
  cin >> n >> m;
  ll ans=1;
  for(int i=2;i<=m;i++){
    int j=i,x=2; ll y=1;
    while(x*x<=i){
      int k=0;
      while(j%x==0){
        j/=x; k++;
      }
      y*=comb(n+k-1,k);
      y%=p;
      x++;
    }
    if(1<j) y=y*n%p;
    ans=(ans+y)%p;
  }
  cout << ans << endl;
}