#include <bits/stdc++.h>
using namespace std;
const pair<int, int> DD[] = {{1, 0},  {1, 1},   {0, 1},  {-1, 1},
                             {-1, 0}, {-1, -1}, {0, -1}, {1, -1}};
template <class T>
T smin(T &a, T b) {
  if (a > b) a = b;
  return a;
}
template <class T>
T smax(T &a, T b) {
  if (a < b) a = b;
  return a;
}
int32_t main(void) {
  srand(time(0));
  cout << fixed << setprecision(7);
  cerr << fixed << setprecision(7);
  static char str[1 << 20];
  cin >> (str + 1);
  long long n = strlen(str + 1);
  static long long f[1 << 20];
  static long long c[1 << 20];
  const long long mod = 1e9 + 7;
  auto pow = [&](long long a, long long b, long long mod) {
    long long ans = 1;
    while (b) {
      if (b & 1) ans = (1ll * ans * a) % mod;
      a = (1ll * a * a) % mod;
      b /= 2;
    }
    return ans;
  };
  f[0] = c[0] = 1;
  for (long long i = 1; i <= 1e6; ++i) {
    f[i] = (1ll * i * f[i - 1]) % mod;
    c[i] = pow(f[i], mod - 2, mod);
  }
  auto C = [&](long long n, long long k) {
    if (!(0 <= k && k <= n)) return 0ll;
    long long ans = f[n];
    ans = (1ll * ans * c[k]) % mod;
    ans = (1ll * ans * c[n - k]) % mod;
    return ans;
  };
  long long ans = 0;
  long long a = 0, b = 0;
  for (long long i = 1; i <= n; ++i) a += (str[i] == ')');
  for (long long i = 1; i <= n; ++i)
    if (str[i] == '(') {
      ++b;
      (ans += C(a + b - 1, a - 1)) %= mod;
    } else
      --a;
  cout << ans << '\n';
  cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms"
       << '\n';
  return 0;
}
