#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int Pow(int a, int b) {
  int x = 1;
  for (; b > 0; b >>= 1) {
    if (b & 1) x = (long long)x * a % mod;
    a = (long long)a * a % mod;
  }
  return x;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  string s;
  cin >> s;
  int n = s.length(), open = 0, close = count(s.begin(), s.end(), ')'), ans = 0;
  vector<int> fac(n + 1), ifac(n + 1);
  fac[0] = ifac[0] = 1;
  for (int i = 1; i <= n; ++i) {
    fac[i] = (long long)fac[i - 1] * i % mod;
    ifac[i] = Pow(fac[i], mod - 2);
  }
  auto comb = [&](int a, int b) {
    if (a < b) return 0LL;
    return (long long)fac[a] * ifac[b] % mod * ifac[a - b] % mod;
  };
  for (int i = 0; i < n; ++i) {
    open += s[i] == '(';
    close -= s[i] == ')';
    if (s[i] == '(') ans = (ans + comb(open - 1 + close, open)) % mod;
  }
  cout << ans << "\n";
  return 0;
}
