#include <bits/stdc++.h>
using namespace std;
const int kN = 4e5 + 5;
const int kMod = 1e9 + 7;
int64_t fact[kN], ifact[kN];
void ComputeFact() {
  fact[0] = 1;
  for (int i = 1; i < kN; ++i) fact[i] = fact[i - 1] * i % kMod;
  ifact[kN - 1] = 977041169;
  for (int i = kN - 2; i >= 0; --i) ifact[i] = ifact[i + 1] * (i + 1) % kMod;
}
int64_t nCr(int n, int r) {
  if (r < 0 || r > n) return 0;
  return fact[n] * ifact[r] % kMod * ifact[n - r] % kMod;
}
int main(int argc, char** argv) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  int l = s.length(), cp = count(s.begin(), s.end(), ')');
  ComputeFact();
  int64_t cnt = 0;
  for (int i = 0, op = 0; i < l; ++i) {
    cp -= s[i] == ')';
    if (s[i] == '(') {
      ++op;
      cnt = (cnt + nCr(op + cp - 1, op)) % kMod;
    }
  }
  cout << cnt << endl;
  return 0;
}
