#include <bits/stdc++.h>
using namespace std;
template <typename T>
T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
T pow(T a, T b, long long m) {
  T ans = 1;
  while (b > 0) {
    if (b % 2 == 1) ans = ((ans % m) * (a % m)) % m;
    b /= 2;
    a = ((a % m) * (a % m)) % m;
  }
  return ans % m;
}
long long fac[200005];
long long cntc[200005];
void factorial() {
  fac[0] = 1;
  for (int i = 1; i < 200005; i++) {
    fac[i] = (fac[i - 1] * i);
    fac[i] %= (long long)(1000 * 1000 * 1000 + 7);
  }
}
long long cal(long long x, long long y) {
  long long nemo = fac[x];
  nemo %= (long long)(1000 * 1000 * 1000 + 7);
  long long deno = (fac[y]);
  deno *= (fac[x - y] % (long long)(1000 * 1000 * 1000 + 7));
  deno %= (long long)(1000 * 1000 * 1000 + 7);
  long long invdeno = pow(deno, (long long)(1000 * 1000 * 1000 + 7) - 2,
                          (long long)(1000 * 1000 * 1000 + 7));
  long long pro = ((nemo % (long long)(1000 * 1000 * 1000 + 7)) *
                   (invdeno % (long long)(1000 * 1000 * 1000 + 7)));
  pro %= (long long)(1000 * 1000 * 1000 + 7);
  return pro;
}
int main() {
  int n;
  string s;
  cin >> s;
  n = s.length();
  factorial();
  long long sumc = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (s[i] == ')') sumc++;
    cntc[i] = sumc;
  }
  long long x = 0;
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      x++;
      ans += (cal(x + cntc[i] - 1, cntc[i] - 1));
      ans %= (long long)(1000 * 1000 * 1000 + 7);
    }
  }
  cout << ans;
}
