#include <bits/stdc++.h>
using namespace std;
const int N = 200005;
const int inf = 1e9 + 5;
const int md = 1e9 + 7;
int n, i, suf[N];
long long fac[N];
long long ans;
string s;
long long bin_pow(long long a, long long b) {
  if (b == 1) return a;
  if (b & 1) return (bin_pow(a, b - 1) * a) % md;
  long long k = bin_pow(a, b >> 1);
  return (k * k) % md;
}
long long C(int n, int k) {
  long long x1 = fac[n];
  long long x2 = fac[n - k];
  long long x3 = fac[k];
  x2 = (x2 * x3) % md;
  x2 = bin_pow(x2, md - 2);
  return (x1 * x2) % md;
}
int main() {
  cin >> s;
  n = s.size();
  fac[0] = 1;
  for (i = 1; i <= n; ++i) fac[i] = (fac[i - 1] * i) % md;
  for (i = n - 1; i > 0; --i)
    if (s[i] == ')')
      suf[i] = suf[i + 1] + 1;
    else
      suf[i] = suf[i + 1];
  int cur = 0;
  for (i = 0; i < n - 1; ++i)
    if (s[i] == '(') {
      if (suf[i + 1] == 0) break;
      ++cur;
      ans = (ans + C(cur + suf[i + 1] - 1, cur)) % md;
    }
  cout << ans;
}
