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