#include <bits/stdc++.h>
using namespace std;
unsigned long long power(unsigned long long a, unsigned long long b) {
  unsigned long long ret = 1;
  while (b) {
    if (b & 1) ret *= a;
    a *= a;
    if (ret >= 1000000007) ret %= 1000000007;
    if (a >= 1000000007) a %= 1000000007;
    b >>= 1;
  }
  return ret;
}
unsigned long long invmod(unsigned long long x) {
  return power(x, 1000000007 - 2);
}
unsigned long long f[1000005] = {0}, inv[1000005] = {0};
void fact() {
  f[0] = 1;
  inv[0] = invmod(1);
  for (unsigned long long i = 1; i <= 1000002; i++) {
    f[i] = (f[i - 1] * i) % 1000000007;
    inv[i] = invmod(f[i]);
  }
}
unsigned long long C(unsigned long long n, unsigned long long r) {
  unsigned long long p =
      (((f[n] * inv[r]) % 1000000007) * inv[n - r]) % 1000000007;
  return p;
}
int main() {
  long long i;
  fact();
  string s;
  cin >> s;
  unsigned long long smr[200009] = {0}, sml[200009] = {0};
  long long n = s.size();
  for (i = 0; i < n; i++) {
    if (i == 0) {
      if (s[i] == '(') sml[i]++;
    } else {
      if (s[i] == '(')
        sml[i] = sml[i - 1] + 1;
      else
        sml[i] = sml[i - 1];
    }
  }
  for (i = n - 1; i >= 0; i--) {
    if (i == n - 1) {
      if (s[i] == ')') smr[i]++;
    } else {
      if (s[i] == ')')
        smr[i] = smr[i + 1] + 1;
      else
        smr[i] = smr[i + 1];
    }
  }
  unsigned long long ans = 0, p = 0, j;
  for (i = 0; i < n; i++) {
    if (s[i] == '(') {
      p = 0;
      p = C(sml[i] + smr[i] - 1, smr[i] - 1);
    }
    ans += p;
    p = 0;
    ans %= 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
