#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007LL;
long long n;
char a[200005];
long long f[200005], g[200005];
long long fac[200005], fac_div[200005];
long long power(long long x, long long y) {
  long long res = 1LL;
  while (y != 0LL) {
    if (y % 2 == 1LL) {
      res = (res * x) % mod;
    }
    y /= 2LL;
    x = (x * x) % mod;
  }
  return res;
}
void init() {
  fac[0] = 1LL;
  for (long long i = 1; i <= 200000; i++) fac[i] = (fac[i - 1] * i) % mod;
  for (long long i = 0; i <= 200000; i++) fac_div[i] = power(fac[i], mod - 2);
}
int main() {
  scanf("%s", a + 1);
  n = (long long)strlen(a + 1);
  for (int i = 1; i <= n; i++) {
    if (a[i] == '(')
      f[i] = f[i - 1] + 1;
    else
      f[i] = f[i - 1];
  }
  for (int i = n; i >= 1; i--) {
    if (a[i] == ')')
      g[i] = g[i + 1] + 1;
    else
      g[i] = g[i + 1];
  }
  init();
  long long res = 0LL;
  long long open = 0, close = g[1];
  for (long long i = 1; i <= n; i++) {
    if (a[i] == ')') close--;
    if (a[i] == '(' && close >= 1) {
      long long sum = 1LL;
      long long x = open + 1, y = open + close;
      sum = (sum * fac[y]) % mod;
      sum = (sum * fac_div[x]) % mod;
      sum = (sum * fac_div[y - x]) % mod;
      res = (res + sum) % mod;
    }
    if (a[i] == '(') open++;
  }
  cout << res << endl;
  return 0;
}
