#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
char s[N];
const int mod = 1e9 + 7;
int l[N], r[N];
long long fac[N], inv[N];
long long fpow(long long x, long long y) {
  long long ans = 1;
  while (y) {
    if (y & 1) ans = (1ll * ans * x) % mod;
    x = (1ll * x * x) % mod;
    y >>= 1;
  }
  return ans;
}
long long C(int n, int m) {
  long long ans = fac[n];
  ans = (1ll * ans * inv[m]) % mod;
  ans = (1ll * ans * inv[n - m]) % mod;
  return ans;
}
int main() {
  scanf("%s", s + 1);
  int n = strlen(s + 1);
  fac[0] = 1;
  inv[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = (1ll * fac[i - 1] * i) % mod;
  inv[n] = fpow(fac[n], mod - 2);
  for (int i = n - 1; i >= 1; i--) inv[i] = 1ll * inv[i + 1] * (i + 1) % mod;
  for (int i = 1; i <= n; i++) l[i] = l[i - 1] + (s[i] == '(');
  for (int i = n; i >= 1; i--) r[i] = r[i + 1] + (s[i] == ')');
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(') {
      ans = (ans + C(l[i] + r[i] - 1, l[i])) % mod;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
