import sys input = sys.stdin.readline def f(T): dp = [[0]*N for _ in range(len(T))] for i in range(N): if S[i]==T[0]: dp[0][i] = 1 for i in range(1, len(T)): acc = [0] for j in range(N): acc.append((acc[-1]+dp[i-1][j])%MOD) for j in range(N): if S[j]==T[i]: dp[i][j] = acc[j] return sum(dp[-1])%MOD N = int(input()) S = input()[:-1] MOD = 10**9+7 T = 'yukicoder' ans = f(T) for i in range(len(T)): ans += f(T[:i]+'?'+T[i+1:]) ans %= MOD print(ans)