#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;using vvi=vector<vi>;using vl=vector<ll>;
using P=pair<int,int>;using PL=pair<ll,ll>;using vp=vector<P>;
const int INF=1<<30,MOD=1000000007;const ll LINF=1ll<<60;
#define _ol3(_1,_2,_3,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a,i##_l=(b);i<i##_l;++i)
#define REP(...) _ol3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)
#define REPR(i,n) for(int i=n-1;i>=0;--i)
#define REPA(i,v) REP(i,v.size())
#define all(v) (v).begin(),(v).end()
#define bit(n) (1ll<<(n))
#define clamp(n,mi,ma) max(min(n,ma),mi)
#define uniq(v) sort(all(v));v.erase(unique(all(v)),v.end())
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define cho(n,a,b) cout<<((n)?a:b)<<endl
#define YES(n) cho(n,"YES","NO")
#define Yes(n) cho(n,"Yes","No")
#define Poss(n) cho(n,"Possible","Impossible")
template<class T>bool chmax(T&a,const T&b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T&a,const T&b){if(a>b){a=b;return 1;}return 0;}
template<class T>ostream&operator<<(ostream&o,const vector<T>&v){for(const T&i:v)o<<i<<' ';return o;}
template<class T,class U>ostream&operator<<(ostream&o,const map<T,U>&v){for(const auto&i:v)o<<i<<' ';return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(T&j:v)i>>j;return i;}
template<class T,class U>ostream&operator<<(ostream&o,const pair<T,U>&p){return o<<p.F<<' '<<p.S;}
template<class T,class U>ostream&operator>>(istream&i,pair<T,U>&p){return i>>p.F>>p.S;}
template<class T>ostream&operator<<(ostream&o,const set<T>&v){for(const T&i:v)o<<i<<' ';return o;}

template<typename T>
T gcd(T a,T b){ // log N
    while((a%=b)&&(b%=a));
    return a|b;
}
template<typename T>
T lcm(T a,T b){
    return a/gcdl(a,b)*b;
}

void yakubun(ll&a,ll&b){
    //if(!b&&!a)return;
    if(!b||!a)return;
    if(!b){a=1;return;}
    if(!a){b=1;return;}

    ll g=gcd(a,b);
    a/=g;
    b/=g;
}

void iikanji(ll&a,ll&b){
    assert(a>=0 && b>=0);
    // hiritu tamotte mod toru
    ll A=1,B=1;
    cerr<<a<<':'<<b<<'>';
    if(!a)A=0;
    if(!b)B=0;
    if(a&&b){
        A=a/gcd(a,b);
        B=b/gcd(a,b);
    }
    while(a>=MOD*A && b>=MOD*B && a+b>MOD){
        a-=MOD*A;
        b-=MOD*B;
    }
    cerr<<a<<':'<<b<<endl;
}

class composite{
public:
    map<ll,ll> factors;
    composite(ll num){
        for(ll p=2;p*p<=num;p++){
            while(num%p==0){
                num /= p;
                factors[p]++;
            }
        }
        if(num>1)factors[num]++;
    }

    composite& operator*=(ll num){
        for(ll p=2;p*p<=num;p++){
            while(num%p==0){
                num /= p;
                factors[p]++;
            }
        }
        if(num>1)factors[num]++;

        return *this;
    }

    ll get(){
        ll ans=1;
        for(const PL&a:factors){
            REP(i,a.S)ans*=a.F;
        }
        return ans;
    }

    ll get_m(){
        ll ans=1;
        for(const PL&a:factors){
            REP(i,a.S){ans*=a.F;ans%=MOD;}
        }
        return ans;
    }

    void clean(){
        for(auto iter=factors.begin();iter!=factors.end();){
            if(iter->S==0)factors.erase(iter++);
            else ++iter;
        }
    }
};

void yakubun(composite&a,composite&b){
    //chrono::system_clock::time_point  start, end;
    //start = chrono::system_clock::now();
    //ll cnt=0;
    for(PL p:a.factors){
        //cnt++;
        if(!b.factors.count(p.F))continue;
        ll mi=min(p.S,b.factors[p.F]);
        a.factors[p.F]-=mi;
        b.factors[p.F]-=mi;
    }
    a.clean();
    b.clean();
    //cerr<<cnt<<endl;
    //end = chrono::system_clock::now();
    //cerr<<chrono::duration_cast<chrono::nanoseconds>(end-start).count()<<endl;
}


int main(){
    cin.tie(0);ios::sync_with_stdio(0);
    int n;string s;
    cin>>n>>s;
    ll dp[26]={}; // dp janai?siranai
    /*ll ans_s=1;
    ll ans_b=1; // bunsuu*/
    composite ans_s(1);
    composite ans_b(1);

    /**/ //chrono::system_clock::time_point  start, end;
    //ll time1=0,time2=0,time3=0;

    REP(i,n){
        ll x=++dp[s[i]-'a'];
        //cerr<<x<<'.'<<endl;
        /*ans_b*=dp[p];
        ans_s*=dp[p];
        ans_s%=MOD*ans_b;
        ans_s++;*/
        //start = chrono::system_clock::now();
        ans_s*=x+1;
        //end = chrono::system_clock::now();
        //time1+=chrono::duration_cast<chrono::microseconds>(end-start).count();

        //start = chrono::system_clock::now();
        ans_b*=x;
        //end = chrono::system_clock::now();
        //time2+=chrono::duration_cast<chrono::microseconds>(end-start).count();

        //ans_s%=MOD*ans_b;
        //cerr<<"yay"<<endl;
        //start = chrono::system_clock::now();
        yakubun(ans_s,ans_b);
        //end = chrono::system_clock::now();
        //time3+=chrono::duration_cast<chrono::microseconds>(end-start).count();

        //cerr<<ans_s.get()<<'/'<<ans_b.get()<<'=';
        //cerr<<ans_s<<'/'<<ans_b<<endl;
        //cerr<<"yoy";
        //ans+=ans/(++dp[p]);
        //REP(j,26)cerr<<dp[j]<<' ';cerr<<endl;
        //assert(ans_b);
    }
    /*cerr<<time1<<endl;
    cerr<<time2<<endl;
    cerr<<time3<<endl;*/

    //cerr<<dp<<endl;
    //assert(ans_b);
    //assert(ans_s%ans_b==0);
    // yakubunn ed
    assert(ans_b.get()==1);
    cout<<((ans_s.get_m())-1)%MOD<<endl;
    return 0;
}


Measured memory_bytes: 512