#include <bits/stdc++.h>
using namespace std;
int n;
char s[200011];
int pre[200011], suf[200011], fac[200011], inv[200011];
const int mod = 1e9 + 7;
int powmod(int a, int b) {
  int ans = 1;
  while (b) {
    if (b & 1) ans = 1ll * ans * a % mod;
    a = 1ll * a * a % mod;
    b >>= 1;
  }
  return ans;
}
int C(int n, int m) { return 1ll * fac[n] * inv[m] % mod * inv[n - m] % mod; }
int main() {
  scanf("%s", s + 1);
  n = strlen(s + 1);
  fac[0] = 1;
  for (int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
  inv[n] = powmod(fac[n], mod - 2);
  for (int i = n; i; i--) inv[i - 1] = 1ll * inv[i] * i % mod;
  for (int i = 1; i <= n; i++) pre[i] = pre[i - 1] + (s[i] == '(');
  for (int i = n; i >= 1; i--) suf[i] = suf[i + 1] + (s[i] == ')');
  int ans = 0;
  for (int i = 1; i <= n; i++)
    if (s[i] == '(')
      ans += C(pre[i] - 1 + suf[i], pre[i]), ans -= ans >= mod ? mod : 0;
  printf("%d\n", ans);
  return 0;
}
