#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long modInverse(long long n, long long p) { return power(n, p - 2, p); }
long long mod = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s;
  cin >> s;
  long long sz = s.length();
  long long answer = 0;
  long long close[s.length()];
  if (s[s.length() - 1] == ')') {
    close[s.length() - 1] = 1;
  } else {
    close[s.length() - 1] = 0;
  }
  for (long long i = sz - 2; i >= 0; i--) {
    if (s[i] == ')') {
      close[i] = close[i + 1] + 1;
    } else {
      close[i] = close[i + 1];
    }
  }
  long long open = 0;
  long long sum = 0;
  long long binom = 0;
  for (long long i = 0; i < s.length() - 1; i++) {
    if (s[i] == '(') {
      open++;
      if (open == 1) {
        answer = (answer + close[i + 1]) % mod;
        sum = close[i + 1] + 1;
        binom = close[i + 1];
      } else {
        binom = (binom * modInverse(open, mod)) % mod;
        binom = (binom * sum) % mod;
        answer = (answer + binom) % mod;
        sum++;
      }
    } else {
      if (open >= 1) {
        binom = (binom * close[i + 1]) % mod;
        binom = (binom * modInverse(sum - 1, mod)) % mod;
        sum--;
      }
    }
  }
  cout << answer;
  return 0;
}
