#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int MAXN = 2e5 + 10;
inline int bin_pow(int base, int exp) {
  if (!exp) return 1;
  if (exp & 1)
    return (unsigned long long)bin_pow(base, exp - 1) * base % MOD;
  else
    return bin_pow((unsigned long long)base * base % MOD, exp >> 1);
}
unsigned long long fact[MAXN];
int binom(int n, int k) {
  return fact[n] * bin_pow(fact[k], MOD - 2) % MOD *
         bin_pow(fact[n - k], MOD - 2) % MOD;
}
void init_fact() {
  fact[0] = 1;
  for (int i = 1; i < MAXN; ++i) fact[i] = fact[i - 1] * i % MOD;
}
int main() {
  ios::sync_with_stdio(false);
  init_fact();
  string input;
  cin >> input;
  auto n = input.size();
  vector<int> rightBrackets(n);
  rightBrackets[n - 1] = input[n - 1] == ')';
  for (int i = n - 2; i >= 0; --i)
    rightBrackets[i] = (input[i] == ')') + rightBrackets[i + 1];
  int leftBrackets = 0;
  int res = 0;
  for (int i = 0; i < n; ++i) {
    if (input[i] == '(') {
      res += binom(leftBrackets + rightBrackets[i], leftBrackets + 1);
      ++leftBrackets;
      res %= MOD;
    }
  }
  cout << res << "\n";
}
