#include <bits/stdc++.h>
using namespace std;
long long a[200005], b[200005], f[200005];
string s;
long long power(long long x, long long n) {
  long long ans = 1;
  while (n) {
    if (n & 1) ans = ans * x % 1000000007;
    x = x * x % 1000000007;
    n /= 2;
  }
  return ans;
}
int main() {
  long long ans = 0, l, i, c1, c2;
  cin >> s;
  if (s[0] == '(') a[0] = 1;
  l = s.size();
  for (i = 1; i < l; i++) {
    if (s[i] == '(')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1];
  }
  for (i = l - 1; i >= 0; i--) {
    if (s[i] == ')')
      b[i] = b[i + 1] + 1;
    else
      b[i] = b[i + 1];
  }
  f[0] = 1;
  for (i = 1; i <= 200000; i++) {
    f[i] = f[i - 1] * i % 1000000007;
  }
  for (i = 0; i < l; i++) {
    if (s[i] == ')') continue;
    c1 = a[i], c2 = a[i] + b[i] - 1;
    ans =
        (ans + f[c2] * power(f[c1] * f[c2 - c1] % 1000000007, 1000000007 - 2) %
                   1000000007) %
        1000000007;
  }
  cout << ans << endl;
  return 0;
}
