#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
const int N = 200005, mod = 1000000007;
char s[N];
int l[N], r[N], len;
long long sum, fac[N], inv[N];
long long fpow(long long a, int b) {
  long long ans = 1;
  for (; b; a = a * a % mod, b >>= 1)
    if (b & 1) ans = ans * a % mod;
  return ans;
}
long long Inv(long long x) { return fpow(x, mod - 2); }
long long C(int a, int b) {
  if (b == 0) return 1;
  return fac[a] * inv[b] % mod * inv[a - b] % mod;
}
int main() {
  scanf("%s", s + 1);
  len = strlen(s + 1);
  for (int i = 1; i <= len - 1; i++) l[i] = l[i - 1] + (s[i] == '(' ? 1 : 0);
  for (int i = len - 1; i >= 1; i--)
    r[i] = r[i + 1] + (s[i + 1] == ')' ? 1 : 0);
  fac[1] = 1, inv[1] = 1;
  for (int i = 2; i <= len; i++)
    fac[i] = fac[i - 1] * i % mod, inv[i] = Inv(fac[i]) % mod;
  for (int i = 1; i <= len - 1; i++)
    if (s[i] == '(') {
      int minn = min(l[i], r[i]);
      sum = (sum + C(l[i] + r[i] - 1, r[i] - 1)) % mod;
    }
  printf("%lld\n", (sum + mod) % mod);
  return 0;
}
