#include <bits/stdc++.h>
using namespace std;
const int maxn = 200000 * 2 + 10;
const int md = 1e9 + 7;
char s[maxn];
int n, pre[maxn], suf[maxn];
long long ans, p[maxn], fac[maxn], inv[maxn];
long long bow(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % md;
    y >>= 1;
    x = x * x % md;
  }
  return res;
}
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= 200000; i++)
    p[i] = (p[i - 1] + (long long)i * (i + 1) % md) % md;
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= 400000; i++) fac[i] = fac[i - 1] * i % md;
  for (int i = 1; i <= 400000; i++) inv[i] = bow(fac[i], md - 2);
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1];
    if (s[i] == '(') pre[i]++;
  }
  for (int i = n; i; i--) {
    suf[i] = suf[i + 1];
    if (s[i] == ')') suf[i]++;
  }
  for (int i = 1; i < n; i++)
    if (s[i] == '(') {
      long long N = pre[i], M = suf[i + 1];
      if (M == 0) continue;
      long long v = fac[N + M - 1] % md * inv[N] % md;
      v = v * inv[M - 1] % md;
      ans = (ans + v) % md;
    }
  cout << ans << endl;
  return 0;
}
