#include <bits/stdc++.h>
using namespace std;
const int MAX_FACT = 200005;
const long long MOD = 1000000007;
long long mod_pow(long long a, long long n) {
  if (n == 0) return 1;
  if (n % 2 == 0) {
    long long t = mod_pow(a, n / 2);
    return ((t * t) % MOD);
  } else
    return ((a * mod_pow(a, n - 1)) % MOD);
}
long long get_result(const vector<long long> &fact, long long a, long long b) {
  long long numerator = fact[a + b - 1];
  long long denominator = (fact[a] * fact[b - 1]) % MOD;
  long long ans = (numerator * mod_pow(denominator, MOD - 2)) % MOD;
  return ans;
}
int main() {
  string s;
  cin >> s;
  vector<long long> fact(MAX_FACT);
  fact[0] = fact[1] = 1;
  for (int i = 2; i < MAX_FACT; i++) fact[i] = (fact[i - 1] * i) % MOD;
  vector<pair<int, int> > cnt(s.size());
  int op_cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '(') op_cnt++;
    cnt[i].first = op_cnt;
  }
  int cl_cnt = 0;
  for (int i = s.size() - 1; i >= 0; i--) {
    if (s[i] == ')') cl_cnt++;
    cnt[i].second = cl_cnt;
  }
  long long res = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == '(' && cnt[i].second != 0)
      res = (res + get_result(fact, cnt[i].first, cnt[i].second)) % MOD;
  cout << res << endl;
}
