import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) throws Exception { BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); String line=in.readLine(); long[] fac=new long[101]; fac[0]=1; for(int i=1;i<=100;i++) { fac[i]=fac[i-1]*i; } //char[] arr=String.toCharArray(line); //Arrays.sort(arr); int w=Integer.parseInt(in.readLine()); for(int i=0;imax) { max=freq[t]; maxcount++; } } } count+=max; ans=fac[(int)count/2]%(1000000007); //fac[count/2] for(int e=0;e<26;e++) { ans/=fac[freq[e]/2]; if(freq[e]%2==1) { ans*=freq[e]%(1000000007); } } System.out.println(ans%1000000007); } } }