#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int me = 200 * 1000 + 10;
long long fact[me];
long long inv[me];
long long binp(long long a, long long b) {
  if (b == 0) return 1;
  if (a == 0) return 0;
  long long res = binp(a, b / 2);
  long long out;
  if (b % 2)
    out = (((res * res) % mod) * a) % mod;
  else
    out = (res * res) % mod;
  return out % mod;
}
void fac() {
  fact[0] = 1;
  inv[0] = 1;
  for (int i = 1; i < me; i++) {
    fact[i] = fact[i - 1] * i;
    fact[i] %= mod;
    inv[i] = binp(fact[i], mod - 2);
  }
}
long long C(int a, int b) {
  long long one = fact[a];
  long long two = inv[b];
  long long to = inv[a - b];
  two *= to;
  two %= mod;
  one *= two;
  one %= mod;
  return one;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  fac();
  string str;
  cin >> str;
  vector<int> pre(str.length(), 0);
  vector<int> suf(str.length(), 0);
  pre[0] = (str[0] == '(' ? 1 : 0);
  for (int i = 1; i < str.length(); i++)
    pre[i] = pre[i - 1] + (str[i] == '(' ? 1 : 0);
  suf[str.length() - 1] = (str[str.length() - 1] == ')' ? 1 : 0);
  for (int i = str.length() - 2; i >= 0; i--)
    suf[i] = suf[i + 1] + (str[i] == ')' ? 1 : 0);
  long long ans = 0;
  for (int i = 0; i < str.length(); i++) {
    if (str[i] == '(' && suf[i] != 0) {
      ans += C(suf[i] + pre[i] - 1, pre[i]);
      ans %= mod;
    }
  }
  cout << ans % mod;
}
