#include <bits/stdc++.h>
using namespace std;
const int sz = 200005;
const long long int mod = 1e9 + 7;
char brac[sz];
pair<long long int, long long int> egcd(long long int a, long long int b) {
  if (a % b == 0) {
    return make_pair(0, 1);
  }
  pair<int, int> xy = egcd(b, a % b);
  return make_pair(xy.second, xy.first - (a / b) * xy.second);
}
long long int gcd(long long int a, long long int b) {
  if (a % b == 0) {
    return b;
  }
  return gcd(b, a % b);
}
long long int inv(long long int a, long long int p) {
  if (gcd(a, p) != 1) {
    return -1;
  }
  return (egcd(a, p).first + p) % p;
}
int fac[sz];
int facinv[sz];
int acc[sz];
int accrev[sz];
long long int pow2(int n) {
  if (n == 0) {
    return 1;
  }
  int h = n / 2;
  long long int h2 = pow2(h);
  if (n % 2 == 0) {
    return (h2 * h2) % mod;
  }
  return (h2 * h2 * 2) % mod;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> brac;
  int len = strlen(brac);
  acc[0] = brac[0] == '(';
  accrev[len - 1] = brac[len - 1] == ')';
  for (int i = 1; i < len; ++i) {
    acc[i] = acc[i - 1] + (brac[i] == '(');
  }
  for (int i = len - 2; i >= 0; --i) {
    accrev[i] = accrev[i + 1] + (brac[i] == ')');
  }
  fac[0] = 1;
  fac[1] = 1;
  facinv[0] = facinv[1] = (int)inv(1, mod);
  for (int i = 2; i <= len; ++i) {
    long long int m = fac[i - 1] * (long long int)i;
    m %= mod;
    fac[i] = (int)m;
    facinv[i] = (int)inv(fac[i], mod);
  }
  auto ways = [](int a, int b) {
    if (a > b) {
      swap(a, b);
    }
    long long int ans =
        (((long long int)fac[a + b] * facinv[b]) % mod) * facinv[a] - 1;
    ans %= mod;
    return ans;
  };
  long long int ans = 0;
  for (int i = 0; i < len; ++i) {
    if (brac[i] == '(') {
      ans += ways(acc[i], accrev[i]) - ways(acc[i] - 1, accrev[i]);
      ans %= mod;
      while (ans < 0) {
        ans += mod;
      }
    }
  }
  cout << ans << endl;
}
