#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
vector<long long> fact;
pair<long long, pair<long long, long long> > extendedEuclid(long long a,
                                                            long long b) {
  if (a == 0) return make_pair(b, make_pair(0, 1));
  pair<long long, pair<long long, long long> > p;
  p = extendedEuclid(b % a, a);
  return make_pair(
      p.first,
      make_pair(p.second.second - p.second.first * (b / a), p.second.first));
}
long long modInverse(long long a, long long m) {
  return (extendedEuclid(a, m).second.first + m) % m;
}
void factorial(long long a) {
  fact.assign(a + 1, 1);
  fact[0] = 1;
  for (long long i = 1; i <= a; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
}
long long n;
long long binomial(long long a, long long b, long long m) {
  if (a < b) return 0;
  long long numerator = fact[a], denominator = (fact[b] * fact[a - b]) % m;
  return ((numerator * modInverse(denominator, m)) % m);
}
int main() {
  factorial(200009 * 10);
  long long ans = 0;
  string s;
  cin >> s;
  n = s.length();
  long long x = 0, y = 0;
  for (int i = 0; i < s.length(); ++i) {
    y += s[i] == ')';
  }
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == ')') {
      y--;
      continue;
    }
    x++;
    ans = (ans + binomial(x + y - 1, x, mod)) % mod;
  }
  cout << ans;
  return 0;
}
