#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9;
const long long INF = 1e18;
const int irand(int lo, int hi) {
  return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
const long long lrand(long long lo, long long hi) {
  return ((double)rand() / (RAND_MAX + 1.0)) * (hi - lo + 1) + lo;
}
const int N = 200005;
const long long MOD = (long long)1e9 + 7;
long long fact[N];
long long F(int x) {
  if (x < 0)
    return 0;
  else
    return fact[x];
}
int n, m;
char in[N];
int pre[N];
long long exp(long long a, long long e) {
  if (e < 0)
    return 1;
  else if (e == 1)
    return a;
  else {
    long long ret = exp(a, e / 2);
    ret = (ret * ret) % MOD;
    if (e & 1) ret = (ret * a) % MOD;
    return ret;
  }
}
long long C(int a, int b) {
  if (b > a) return 0;
  return (F(a) * exp((F(a - b) * F(b)) % MOD, MOD - 2)) % MOD;
}
int main() {
  ios_base::sync_with_stdio(0);
  fact[0] = 1;
  for (int i = 1; i <= N - 5; i += 1) {
    fact[i] = (fact[i - 1] * i) % MOD;
  }
  scanf("%s", in);
  m = strlen(in);
  n = 0;
  for (int i = 0; i <= m - 1; i += 1) {
    if (in[i] == '(') n++;
  }
  for (int i = m - 1, nn = n, cnt = 0; i >= 0; i--) {
    if (in[i] == ')') {
      cnt++;
    } else {
      pre[nn--] = cnt;
    }
  }
  long long ans = 0;
  for (int i = 1; i <= n; i += 1) {
    ans = (ans + C(i + pre[i] - 1, i)) % MOD;
  }
  cout << ans << endl;
  return 0;
}
