#include <bits/stdc++.h>
using namespace std;
long long op, clo;
string s;
long long ans;
long long tmp;
long long fac[200005];
long long inv(long long x) {
  long long res = 1;
  long long b = 1000000005;
  while (b) {
    if (b & 1) res = (res * x) % 1000000007;
    x = (x * x) % 1000000007;
    b >>= 1;
  }
  return res;
}
int main() {
  cin >> s;
  for (int i = 0; i < (int)s.size(); ++i)
    if (s[i] == ')') ++clo;
  fac[0] = 1;
  for (int i = 1; i < 200005; ++i) fac[i] = (fac[i - 1] * i) % 1000000007;
  for (int i = 0; i < (int)s.size(); ++i) {
    if (s[i] == ')') --clo;
    if (s[i] == '(') {
      if (clo > 0) {
        tmp = (((fac[op + clo] * inv(fac[clo - 1])) % 1000000007) *
               inv(fac[op + 1])) %
              1000000007;
        ans = (ans + tmp) % 1000000007;
      }
      ++op;
    }
  }
  cout << ans << '\n';
  return 0;
}
