#include <bits/stdc++.h>
using namespace std;
void rs(int &x) { scanf("%d", &x); }
void rsl(long long &x) { scanf("%I64d", &x); }
void rsd(double &x) { scanf("%lf", &x); }
void rss(char *str) { scanf("%s", str); }
void ws(int &x) { printf("%d ", x); }
void wsl(long long &x) { printf("%I64d ", x); }
void wsd(double &x) { printf("%lf ", x); }
void wss(char *str) { printf("%s ", str); }
long long gcd(long long a, long long b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int const N = (2e5) + 5;
int const mod = (1e9) + 7;
int first[N], inf[N];
int cnt[N];
vector<pair<int, int>> fa;
int pm(long long n, int deg) {
  long long res = 1;
  while (deg > 0) {
    if (deg & 1) {
      res *= n;
      res %= mod;
    }
    n *= n;
    n %= mod;
    deg >>= 1;
  }
  return res;
}
void prec() {
  first[0] = 1;
  for (int i = 1; i < N - 1; ++i) {
    first[i] = (i * (long long)first[i - 1]) % mod;
  }
  int inN = pm(first[N - 2], mod - 2);
  inf[N - 2] = inN;
  for (int i = N - 3; i > 0; --i) {
    inf[i] = (inf[i + 1] * (long long)(i + 1)) % mod;
  }
  inf[0] = 1;
}
int bin(int n, int k) {
  if (k > n || n < 0) return 0;
  long long res = first[n] * ((long long)inf[k] * inf[n - k] % mod) % mod;
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  ifstream in("input.txt");
  ofstream out("output.txt");
  string second;
  cin >> second;
  prec();
  int n = second.size();
  for (int i = n - 1; i >= 0; --i) {
    cnt[i] = cnt[i + 1];
    if (second[i] == ')') {
      cnt[i]++;
    }
  }
  int co = 0;
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (second[i] == '(') {
      co++;
      ans += bin(co + cnt[i] - 1, co);
      if (ans > mod) {
        ans -= mod;
      }
    }
  }
  cout << ans;
  return 0;
}
