#include <bits/stdc++.h>
using namespace std;
long long int bigmod(long long int a, long long int p) {
  if (p == 0ll) return 1ll;
  if (p % 2 == 1) return ((a % 1000000007) * bigmod(a, p - 1)) % 1000000007;
  long long int b = bigmod(a, p / 2ll);
  return (b * b) % 1000000007;
}
long long int fact[200010], invfact[200010];
void pre() {
  fact[0] = invfact[0] = 1ll;
  fact[1] = invfact[1] = 1ll;
  for (long long int i = 2; i < 200010; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
  for (long long int i = 2; i < 200010; i++) {
    invfact[i] = (invfact[i - 1] * bigmod(i, 1000000007 - 2)) % 1000000007;
  }
  return;
}
long long int nCr(long long int n, long long int r) {
  if (n < r) return 0;
  long long int ans = fact[n];
  ans = (ans * invfact[r]) % 1000000007;
  ans = (ans * invfact[n - r]) % 1000000007;
  return ans;
}
char str[200010];
int main() {
  pre();
  scanf("%s", str);
  int d = strlen(str);
  int n = 0, m = 0;
  for (int i = d - 1; i >= 0; i--)
    if (str[i] == '(') n++;
  long long int ans = 0;
  for (int i = d - 1; i >= 0; i--)
    if (str[i] == '(')
      n--;
    else if (str[i] == ')') {
      ans = (ans + nCr(n + m, n - 1)) % 1000000007;
      m++;
    }
  cout << ans << endl;
  return 0;
}
