def main(): N=int(input()) S=input() dp=[[0]*2 for __ in range(10)] T=set("yukicoder") d={"y":0,"u":1,"k":2,"i":3,"c":4,"o":5,"d":6,"e":7,"r":8} mod=10**9+7 for i in range(N): if S[i] in T: if S[i]=="y": dp[0][0]+=1 else: x=d[S[i]] dp[x][0]+=dp[x-1][0] dp[x][0]%=mod dp[x][1]+=dp[x-1][1] dp[x][1]%=mod elif S[i]=="?": dp[0][1]+=1 for j in range(8): dp[j+1][1]+=dp[j][0] dp[j+1][1]%=mod print((dp[8][0]+dp[8][1])%mod) return main()