aaaaabb
 aabaaaa
 babbabaabbbbabwbvbhbbbaaabbabbbbbbbkabbbbabaaabbbbbbajabbaaabazbbbzbalbabbwbbaabbabacabdbabbbfaaabbb
 baaahbbbba
 ababavvvv
 abnxabbaab
 krflnzhter
 amaabbbbxaabbbabaabaabbaaabaaaaabibbabaabaaabaabcaaxabablbbbbmbbbaaaaaabbaabbbaaabaaaababaababbabbbb
 babbbaaaaaabbbaabaaaaaoaabababaababaaaaababaaaaaaabbbbbbaaapaabaaabaaababaaaabaaaabaaaaababaaaabaaab

5
 14
 42467327
 7
 7
 11
 0
 98718509
 813881762

#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9;
const int MAX = 200009;
const long long MOD = 1000000007;
long long pw(long long base, long long expo, long long c) {
  if (expo == 0) return 1;
  long long f = pw(base, expo / 2, c);
  if (expo & 1) return (((f * f) % c) * base) % c;
  return (f * f) % c;
}
long long n, m;
long long A[MAX];
int main() {
  scanf("%lld%lld", &n, &m);
  string s;
  cin >> s;
  n = s.length();
  vector<char> v;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a' || s[i] == 'b') v.push_back(s[i]);
  }
  long long ans = 1;
  long long cur = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i] == 'a') {
      cur++;
    } else {
      ans = (ans * (cur + 1) % MOD + MOD) % MOD;
      cur = 0;
    }
  }
  ans = (ans * (cur + 1) % MOD + MOD) % MOD;
  ans = (ans - 1 + MOD) % MOD;
  printf("%lld\n", ans);
  return 0;
}
