#include <bits/stdc++.h>
using namespace std;
const int inf = 2000000000;
const int md = 1e9 + 7;
const int N = 2e5 + 5;
long long fact[N], _fact[N];
int binpow(int a, int b) {
  if (b == 0) {
    return 1;
  }
  if (b & 1) {
    return 1ll * a * binpow(a, b - 1) % md;
  }
  long long f = binpow(a, b / 2);
  return f * f % md;
}
int inv(int first) { return binpow(first, md - 2); }
int c(int n, int k) { return fact[n] * _fact[k] % md * _fact[n - k] % md; }
int f(int first, int second) { return c(first + second, first); }
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  string s;
  cin >> s;
  fact[0] = 1;
  _fact[0] = inv(fact[0]);
  for (int i = 1; i <= N; i++) {
    fact[i] = fact[i - 1] * i % md;
    _fact[i] = inv(fact[i]);
  }
  int n = s.length(), ans = 0;
  int p[n + 2], sf[n + 2];
  p[0] = sf[n + 1] = 0;
  for (int i = 1; i <= n; i++) {
    p[i] = p[i - 1] + (s[i - 1] == '(');
  }
  for (int i = n; i > 0; i--) {
    sf[i] = sf[i + 1] + (s[i - 1] == ')');
  }
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == '(') {
      int first = p[i];
      int second = sf[i];
      if (second > 0) {
        ans = (ans + f(first, second - 1)) % md;
      }
    }
  }
  cout << ans;
}
