#include <bits/stdc++.h>
using namespace std;
const long long mod1 = 19260817;
const long long mod2 = 19660813;
char s[200005];
int s1[200005];
int s2[200005];
int n;
long long inv[200005];
long long invf[200005];
long long fac[200005];
long long C(int n, int m) {
  if (n < 0 || m < 0 || m > n) return 0;
  if (m == 0 || m == n) return 1;
  return fac[n] * invf[n - m] % 1000000007 * invf[m] % 1000000007;
}
void init() {
  inv[1] = inv[0] = 1LL;
  for (long long i = 2; i < 200005; ++i)
    inv[i] = (1000000007 - 1000000007 / i) * inv[1000000007 % i] % 1000000007;
  invf[0] = 1LL;
  for (long long i = 1; i < 200005; ++i)
    invf[i] = invf[i - 1] * inv[i] % 1000000007;
  fac[0] = 1LL;
  for (long long i = 1; i < 200005; ++i) fac[i] = fac[i - 1] * i % 1000000007;
}
int main() {
  init();
  scanf("%s", s + 1);
  n = (int)strlen(s + 1);
  for (int i = 1; i <= n; ++i) s1[i] = s1[i - 1] + (s[i] == '(');
  for (int i = n; i >= 1; --i) s2[i] = s2[i + 1] + (s[i] == ')');
  long long ans = 0;
  for (int i = 1; i <= n; ++i) {
    if (s[i] == ')') continue;
    int S1 = s1[i];
    int S2 = s2[i];
    ans = (ans + C(S1 + S2, S1) - C(S1 + S2 - 1, S1 - 1)) % 1000000007;
    ans = (ans + 1000000007) % 1000000007;
  }
  printf("%lld\n", ans);
  return 0;
}
