#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vll = vector<long long>;
using vpi = vector<pair<int, int>>;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
const char nl = '\n';
const ll MOD = 1e9 + 7;
const int N = 200020;
ll power(ll a, ll b) {
  ll x = 1, y = a;
  while (b) {
    if (b % 2) x = (x * y) % MOD;
    y = (y * y) % MOD;
    b /= 2;
  }
  return x % MOD;
}
ll inv(ll x) { return power(x, MOD - 2); }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  vll f(N), fi(N);
  f[0] = 1;
  fi[0] = 1;
  for (int i = (1); i < (N); ++i) f[i] = (f[i - 1] * i) % MOD;
  fi[N - 1] = inv(f[N - 1]);
  for (int i = (N - 2); i >= (1); --i) fi[i] = (fi[i + 1] * (i + 1)) % MOD;
  const auto fac = [&](int a, int b) -> ll {
    return f[a] * fi[b] % MOD * fi[a - b] % MOD;
  };
  string s;
  cin >> s;
  const int n = (int)s.size();
  int l = 0, r = 0;
  for (int i = (n - 1); i >= (0); --i)
    if (s[i] == ')') r++;
  ll ans = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] == '(') {
      l++;
      if (r > 0) ans = (ans + fac(l + r - 1, r - 1)) % MOD;
    } else {
      r--;
    }
  }
  cout << ans << nl;
  return 0;
}
