#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 1;
const int M = 1e9 + 7;
const double eps = 1e-6;
const double PI(acos(-1.0));
string s;
long long g[N], inv[N];
int p[N], f[N];
long long pw(long long a, long long b, long long M) {
  return b ? b & 1 ? a * pw(a, b - 1, M) % M : pw(a * a % M, b >> 1, M) : 1;
}
int C(int n, int m) {
  if (n < m) return 0;
  return g[n] * inv[m] % M * inv[n - m] % M;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long ans = 0;
  cin >> s;
  g[0] = inv[0] = g[1] = inv[1] = 1;
  for (int i = (2); i <= (((int)s.size())); i++) {
    g[i] = g[i - 1] * i % M;
    inv[i] = pw(g[i], M - 2, M);
  }
  for (int i = 0; i < (((int)s.size())); i++) {
    f[i] = s[i] == '(';
    if (i) f[i] += f[i - 1];
  }
  int cnt = 0;
  for (int i = ((int)s.size()) - 1; ~i; i--) {
    if (s[i] == ')')
      cnt++;
    else {
      long long x = f[i];
      long long y = cnt;
      ans = ans + C(x + y - 1, x);
      ans %= M;
    }
  }
  cout << ans << endl;
}
