#include <bits/stdc++.h>
using namespace std;
const long long infll = powl(2, 62) - 1;
const long long mod = pow(10, 9) + 7;
int64_t extGcd(int64_t a, int64_t b, int64_t& x, int64_t& y) {
  if (!a) {
    x = 0;
    y = 1;
    return b;
  }
  int64_t x1, y1;
  int64_t d = extGcd(b % a, a, x1, y1);
  x = y1 - (b / a) * x1;
  y = x1;
  return d;
}
inline long long addMod(long long a, long long b, long long m = mod) {
  return ((int64_t)a + b) % m;
}
inline long long mulMod(long long a, long long b, long long m = mod) {
  return ((int64_t)a * b) % m;
}
inline long long divMod(long long a, long long b, long long m = mod) {
  int64_t x, y;
  int64_t g = extGcd(b, m, x, y);
  if (g != 1) {
    cerr << "Bad gcd!" << endl;
    for (;;)
      ;
  }
  x = (x % m + m) % m;
  return mulMod(a, x, m);
}
const long long factRange = 1000000;
long long fact[factRange];
inline void precalcFactorials() {
  fact[0] = 1;
  for (long long i = 1; i < factRange; i++) {
    fact[i] = mulMod(fact[i - 1], i);
  }
}
inline long long F(long long n) { return (n < 0) ? 0 : fact[n]; }
inline long long C(long long n, long long k) {
  return divMod(F(n), mulMod(F(n - k), F(k)));
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  precalcFactorials();
  string bracket;
  cin >> bracket;
  vector<long long> open(bracket.size()), close(bracket.size());
  long long count = 0;
  for (long long i = 0; i < (long long)(bracket.size()); ++i) {
    if (bracket[i] == '(') count++;
    open[i] = count;
  }
  count = 0;
  for (long long i = (long long)(bracket.size()) - 1; i >= 0; --i) {
    if (bracket[i] == ')') count++;
    close[i] = count;
  }
  long long ans = 0;
  for (long long i = 0; i < (long long)(bracket.size()); ++i) {
    if (bracket[i] != '(' || close[i] == 0) continue;
    if (bracket[i] == '(') {
      ans += C(open[i] + close[i] - 1, open[i]);
      ans %= mod;
    }
  }
  cout << ans << endl;
  return 0;
}
