#include <bits/stdc++.h>
using namespace std;
using LL = int64_t;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
LL fac[maxn];
void init() {
  fac[0] = 1;
  for (int i = 1; i <= maxn; i++) fac[i] = (LL)fac[i - 1] % mod * i % mod;
}
LL q_pow(LL x, LL n) {
  LL ans = 1;
  while (n) {
    if (n & 1) ans = ans % mod * x % mod;
    n >>= 1;
    x = (x % mod) * x % mod;
  }
  return ans;
}
LL C(LL n, LL m) {
  if (m > n) return 0;
  return (LL)fac[n] * q_pow(fac[m] * fac[n - m] % mod, mod - 2) % mod;
}
LL Lucas(LL n, LL m) {
  if (m == 0) return 1;
  return (LL)(C(n % mod, m % mod) * Lucas(n / mod, m / mod) % mod);
}
int main() {
  init();
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s;
  cin >> s;
  int r = 0, n = s.length();
  for (int i = 0; i < n; i++)
    if (s[i] == ')') r++;
  LL ans = 0;
  int l = 0;
  for (int i = 0; i < n; i++) {
    if (r == 0) break;
    if (s[i] == '(') {
      if (l < r - 1)
        ans = (ans + C(l + r, l + 1)) % mod;
      else
        ans = (ans + C(l + r, r - 1)) % mod;
      l++;
    } else
      r--;
  }
  cout << ans;
  return 0;
}
