#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int mn = 2e5 + 10;
long long fact[mn];
int l[mn], r[mn];
long long inv(long long x) {
  long long ans = 1;
  for (long long i = mod - 2; i; i >>= 1, x = x * x % mod)
    if (i & 1) ans = ans * x % mod;
  return ans;
}
long long ch(long long a, long long b) {
  if (a < 0 || b < 0 || b > a) return 0;
  return fact[a] * inv(fact[a - b]) % mod * inv(fact[b]) % mod;
}
int main() {
  string s;
  cin >> s;
  int n = s.size(), i;
  fact[0] = 1;
  for (i = 1; i <= n; i++) fact[i] = fact[i - 1] * i % mod;
  l[0] = (s[0] == '(');
  r[n - 1] = (s[n - 1] == ')');
  for (i = 1; i < n; i++) l[i] = l[i - 1] + (s[i] == '(');
  for (i = n - 2; i >= 0; i--) r[i] = r[i + 1] + (s[i] == ')');
  long long ans = 0;
  for (i = 0; i < n - 1; i++)
    if (s[i] == '(')
      ans += ch(l[i] + r[i + 1], l[i]) - ch(l[i] + r[i + 1] - 1, l[i] - 1);
  ans %= mod;
  if (ans < 0) ans += mod;
  printf("%lld", ans);
}
