#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
const int NMAX = 400005;
long long fact[NMAX], refact[NMAX];
long long c(long long n, long long k) {
  return (((fact[n] * (long long)refact[k]) % mod * (long long)refact[n - k]) %
          mod);
}
long long bin(long long a, long long n) {
  if (n == 0) {
    return 1;
  }
  if (!(n & 1)) {
    long long t = bin(a, n / 2);
    return (t * (long long)t) % mod;
  } else {
    long long t = bin(a, n - 1);
    return (t * (long long)a) % mod;
  }
}
long long suff[NMAX], pref[NMAX];
int main() {
  srand((unsigned int)time(NULL));
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  fact[0] = 1;
  refact[0] = 1;
  for (long long i = 1; i < NMAX; i++) {
    fact[i] = (fact[i - 1] * i) % mod;
    refact[i] = bin(fact[i], mod - 2);
  }
  string s;
  cin >> s;
  s = '#' + s;
  int n = (int)s.size();
  for (int i = 1; i < n; i++) {
    if (s[i] == '(') {
      pref[i] = pref[i - 1] + 1;
    } else {
      pref[i] = pref[i - 1];
    }
  }
  for (int i = n - 1; i >= 1; i--) {
    if (s[i] == ')') {
      suff[i] = suff[i + 1] + 1;
    } else {
      suff[i] = suff[i + 1];
    }
  }
  long long ans = 0;
  for (int i = 1; i < n; i++) {
    if (s[i] == '(') {
      long long N = suff[i] + pref[i] - 1;
      long long K = pref[i];
      ans = (ans + c(suff[i] + pref[i] - 1, pref[i])) % mod;
    }
  }
  cout << ans;
}
