#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200005;
const int MOD = 1000000007;
long long fact[MAXN], inv[MAXN], dp[MAXN], ans;
string s;
long long mod_pow(long long a, long long b, long long m) {
  long long ans;
  for (ans = 1; b; b >>= 1) {
    if (b & 1) ans = ans * a % m;
    a = a * a % m;
  }
  return ans;
}
void pre() {
  fact[0] = 1;
  for (long long i = 1; i < MAXN; i++) fact[i] = fact[i - 1] * i % MOD;
  inv[MAXN - 1] = mod_pow(fact[MAXN - 1], MOD - 2, MOD);
  for (long long i = MAXN - 2; i >= 0; i--) inv[i] = inv[i + 1] * (i + 1) % MOD;
}
long long ncr(long long a, long long b) {
  long long ans = fact[a] * inv[b] % MOD * inv[a - b] % MOD;
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  pre();
  cin >> s;
  int n = s.length();
  int close = 0;
  int open = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == ')') close++;
  }
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == ')')
      close--;
    else {
      ans = (ans + ncr(close + open, close - 1) + MOD) % MOD;
      open++;
    }
    if (close == 0) break;
  }
  cout << ans << '\n';
  return 0;
}
