#include <bits/stdc++.h>
using namespace std;
int pre[200005];
int post[200005];
char s[200005];
long long fac[200005];
const long long mod = 1e9 + 7;
void init() {
  int i;
  fac[0] = 1;
  for (i = 1; i <= 200000; i++) fac[i] = fac[i - 1] * i % mod;
}
long long pow(long long a, long long b) {
  long long tmp = a % mod, ans = 1;
  while (b) {
    if (b & 1) ans = ans * tmp % mod;
    tmp = tmp * tmp % mod;
    b >>= 1;
  }
  return ans;
}
long long C(long long n, long long m) {
  if (m > n || m < 0) return 0;
  return fac[n] * pow(fac[m] * fac[n - m], mod - 2) % mod;
}
int main() {
  init();
  scanf("%s", s);
  int len = strlen(s);
  long long ans = 0;
  for (int i = 0; i <= len - 1; i++)
    if (s[i] == '(')
      pre[i] = pre[max(i - 1, 0)] + 1;
    else
      pre[i] = pre[max(i - 1, 0)];
  for (int i = len - 1; i >= 0; i--)
    if (s[i] == ')')
      post[i] = post[min(i + 1, len - 1)] + 1;
    else
      post[i] = post[min(i + 1, len - 1)];
  for (int i = 0; i <= len - 1; i++) {
    if (s[i] == '(') ans += C(pre[i] + post[i] - 1, post[i] - 1), ans %= mod;
  }
  printf("%lld\n", ans);
  return 0;
}
