#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5, mod = 1e9 + 7;
string S;
long long int ans, A[N], R[N], L[N], F[N];
long long int pw(long long int a, long long int b) {
  long long int r = 1;
  while (b > 0) {
    if (b & 1) r *= a, r %= mod;
    b >>= 1;
    a *= a;
    a %= mod;
  }
  return (r + mod) % mod;
}
long long int inv(long long int x) { return (pw(x, mod - 2) + mod) % mod; }
int main() {
  cin >> S;
  int n = S.size();
  for (int i = 1; i <= n; i++) {
    if (S[i - 1] == '(')
      L[i] = 1;
    else
      R[i] = 1;
  }
  for (int i = 1; i < N; i++) {
    L[i] += L[i - 1];
    R[i] += R[i - 1];
  }
  F[0] = 1;
  for (int i = 1; i < N; i++) {
    F[i] = F[i - 1] * i;
    F[i] %= mod;
  }
  for (int i = 1; i <= n; i++) {
    if (S[i - 1] == ')') continue;
    long long int l = L[i - 1];
    long long int r = R[n] - R[i];
    long long int add = (F[l + r] * (inv(F[r - 1]))) % mod;
    add *= inv(F[l + 1]);
    add %= mod;
    ans = (ans + add) % mod;
  }
  cout << ans << endl;
  return 0;
}
