#include <bits/stdc++.h>
const int P = 1e9 + 7, N = 200050;
long long jc[N], fac[N];
int n;
long long C(int n, int m) { return jc[n] * fac[m] % P * fac[n - m] % P; }
long long ksm(long long x, int k) {
  long long ans = 1;
  int i = 1;
  while (i <= k) {
    if ((i & k) > 0) ans = ans * x % P;
    x = x * x % P;
    i = i * 2;
  }
  return ans;
}
int main() {
  char ch[N];
  scanf("%s", ch + 1);
  n = strlen(ch + 1);
  jc[1] = 1;
  for (int i = 2; i <= n; i++) jc[i] = jc[i - 1] * i % P;
  fac[n] = ksm(jc[n], P - 2);
  for (int i = n - 1; i >= 0; i--) fac[i] = fac[i + 1] * (i + 1) % P;
  int l = 0, r = 0;
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    if (ch[i] == ')') r++;
  for (int i = 1; i <= n; i++)
    if (ch[i] == '(') {
      l++;
      ans += C(l + r - 1, l);
    } else
      r--;
  printf("%I64d\n", ans % P);
  return 0;
}
