#include <bits/stdc++.h>
using namespace std;
long long int pwr(long long int a, long long int b) {
  if (b == 0) {
    return 1;
  }
  long long int ans = 1;
  while (b) {
    if (b & 1) {
      ans = ((ans % (int)(1e9 + 7)) * (a % (int)(1e9 + 7))) % (int)(1e9 + 7);
    }
    b /= 2;
    a = ((a % (int)(1e9 + 7)) * (a % (int)(1e9 + 7))) % (int)(1e9 + 7);
  }
  return ans;
}
long long inv(long long a) { return pwr(a, (int)(1e9 + 7) - 2); }
long long fact[1000003], invfact[1000003];
void compute() {
  long long x = 1, i, z = 1;
  fact[0] = invfact[0] = 1;
  for (i = 1; i < 1000003; i++) {
    z = ((z % (int)(1e9 + 7)) * (i % (int)(1e9 + 7))) % (int)(1e9 + 7);
    fact[i] = z;
    x = (x % (int)(1e9 + 7) * (inv(i) % (int)(1e9 + 7))) % (int)(1e9 + 7);
    invfact[i] = x;
  }
}
int C(int n, int r) {
  if (n < r) return 0;
  if (r == 0 || n == r) return 1;
  return (fact[n] * ((invfact[r] * invfact[n - r]) % (int)(1e9 + 7))) %
         (int)(1e9 + 7);
}
string s;
int L[200005];
int R[200005];
int main() {
  compute();
  cin >> s;
  int n = s.size();
  s = " " + s;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(') {
      L[i] = 1;
    }
  }
  for (int i = n; i >= 1; i--) {
    if (s[i] == ')') {
      R[i] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    L[i] += L[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    R[i] += R[i + 1];
  }
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    if (s[i] == '(') {
      ans += C(L[i] + R[i] - 1, R[i] - 1);
      ans %= (int)(1e9 + 7);
    }
  }
  cout << ans << endl;
}
