#include <bits/stdc++.h>
using namespace std;
const int maxN = 200100, Mod = 1000000007;
long long pw(long long first, long long p) {
  long long r = 1, t = p, l = 0;
  while (t) t /= 2, l++;
  for (int i = l - 1; i > -1; i--) {
    r = r * r % Mod;
    if ((p >> i) & 1) r = r * first % Mod;
  }
  return r;
}
string s;
long long cnt[maxN];
long long fra[maxN], frp[maxN];
int N, M;
long long C(long long a, long long b) {
  return fra[a] * frp[b] % Mod * frp[a - b] % Mod;
}
int main() {
  cin >> s;
  N = s.size();
  for (int i = (int)s.size() - 1; i > -1; i--) {
    cnt[i] = cnt[i + 1];
    if (s[i] == ')') cnt[i]++;
  }
  fra[0] = frp[0] = 1;
  for (int i = 1; i <= N; i++) {
    fra[i] = fra[i - 1] * i % Mod;
    frp[i] = frp[i - 1] * pw(i, Mod - 2) % Mod;
  }
  long long ans = 0;
  for (int i = 0, c = 0; i < s.size(); i++) {
    if (s[i] == '(') {
      c++;
      if (c && cnt[i + 1])
        ans = (ans + C(c + cnt[i + 1] - 1, cnt[i + 1] - 1)) % Mod;
    }
  }
  cout << ans << endl;
  return 0;
}
