#include #define lli long long int #define pb push_back #define SIZE 100005 #define MAX 1e18 #define mod 1000000007 using namespace std; lli F[100010]; lli d, x, y; void extendedEuclid(lli A, lli B) { if(B == 0) { d = A; x = 1; y = 0; } else { extendedEuclid(B, A%B); lli temp = x; x = y; y = temp - (A/B)*y; } } lli modInverse(lli A, lli M) { extendedEuclid(A,M); return (x%M+M)%M; //x may be negative } void seive() { F[0] = 1; lli i; for(i=1;i<100010;i++) F[i] = (F[i-1]*i)%mod; } int main() { lli N,i,j,k,ans,odds = 0,Q,l,r,den; seive(); string str; cin>>str; N = str.length(); lli pre[N+1][26]; for(j=0;j<26;j++) pre[0][j] = 0; for(i=1;i<=N;i++) { for(j=0;j<26;j++) pre[i][j] = pre[i-1][j]; pre[i][str[i-1]-'a']+=1; } /* for(i=0;i>Q; while(Q--) { cin>>l>>r; den =1; ans = 0; odds = 0; for(j=0;j<26;j++) { k = pre[r][j] - pre[l-1][j]; if(k % 2 == 1) odds++; k /= 2; ans += k; den = (den*F[k])%mod; } ans = (F[ans]*modInverse(den,mod))%mod; if(odds > 0) ans = (ans*odds)%mod; cout<