#include <bits/stdc++.h>
using namespace std;
long long p[200005], q[200005];
int s1[200005], s2[200005];
int n;
long long ans;
long long mul(long long x, long long y) {
  long long ret = 1;
  while (y) {
    if (y % 2 == 1) ret = ret * x % 1000000007;
    x = x * x % 1000000007;
    y /= 2;
  }
  return ret;
}
long long C(long long x, long long y) {
  return p[x] * q[y] % 1000000007 * q[x - y] % 1000000007;
}
int main() {
  char c = getchar();
  while (c != '(' && c != ')') c = getchar();
  while (c == '(' || c == ')') {
    n++;
    if (c == '(')
      s1[n] = s1[n - 1] + 1;
    else
      s1[n] = s1[n - 1];
    c = getchar();
  }
  for (int i = n; i >= 1; i--) {
    s2[i] = s2[i + 1];
    if (s1[i] == s1[i - 1]) s2[i]++;
  }
  p[0] = q[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = p[i - 1] * i % 1000000007;
  q[n] = mul(p[n], 1000000007 - 2);
  for (int i = n - 1; i >= 1; i--) q[i] = q[i + 1] * (i + 1) % 1000000007;
  for (int i = 1; i <= n; i++) {
    if (s1[i] == s1[i - 1]) continue;
    ans = (ans + C(s1[i] + s2[i], s1[i]) - C(s1[i - 1] + s2[i], s1[i - 1]) +
           1000000007) %
          1000000007;
  }
  printf("%lld", ans);
  return 0;
}
