#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 2 * 1e5;
const long long mod = 1e9 + 7;
long long len, fact[MAXN + 5], inv[MAXN + 5];
long long pref[MAXN + 5], suf[MAXN + 5];
string in;
long long nck(long long n, long long k) {
  long long tmp1 = fact[n];
  long long tmp2 = inv[k];
  long long tmp = inv[n - k];
  return ((tmp2 * tmp) % mod * tmp1) % mod;
}
long long pw(long long a, long long b) {
  if (b == 0)
    return 1;
  else {
    long long tmp = pw(a, b / 2);
    if (b % 2)
      return ((tmp * tmp) % mod * a) % mod;
    else
      return (tmp * tmp) % mod;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> in;
  len = in.length();
  fact[0] = 1;
  inv[0] = 1;
  for (long long i = 1; i <= len; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    inv[i] = pw(fact[i], mod - 2) % mod;
  }
  for (long long i = 0; i < len; i++) {
    if (i > 0) pref[i] = pref[i - 1];
    if (in[i] == '(') pref[i]++;
  }
  for (long long i = len - 1; i >= 0; i--) {
    suf[i] = suf[i + 1];
    if (in[i] == ')') suf[i]++;
  }
  long long ans = 0;
  for (long long i = 0; i < len; i++) {
    long long l = pref[i], r = suf[i];
    if (in[i] != '(' || r == 0) continue;
    long long add = nck(l + r - 1, l);
    ans = (ans + add) % mod;
  }
  cout << ans << endl;
  return 0;
}
