#include <bits/stdc++.h>
using namespace std;
const long long MOD = (long long)1e9 + 7;
const int SIZE = 2e5 + 5;
const long long INF = 1LL << 60;
const double eps = 1e-4;
const double PI = 3.1415926535897932;
long long f[200009];
long long inv[200009];
long long expo(long long a, long long b) {
  if (b == 0) return 1;
  long long h = expo(a, b / 2);
  h = (h * h) % MOD;
  if (b % 2) h = (h * a) % MOD;
  return h;
}
long long choose(long long a, long long b) {
  return ((f[a] * inv[b]) % MOD * inv[a - b]) % MOD;
}
char s[200009];
int rs[200009], rs2[200009];
int main() {
  scanf("%s", (s));
  int n = strlen(s);
  f[0] = inv[0] = 1;
  for (int i = (1); i < (n + 1); ++i) {
    f[i] = (f[i - 1] * i) % MOD;
    inv[i] = expo(f[i], MOD - 2);
  }
  for (int i = 0; i < (n); ++i) {
    rs[i] = (s[i] == '(') + (i ? rs[i - 1] : 0);
  }
  for (int i = n - 1; i >= 0; i--) {
    rs2[i] = rs2[i + 1] + (s[i] == ')');
  }
  long long ans = 0;
  for (int i = 0; i < (n); ++i) {
    if (s[i] != '(') continue;
    if (rs2[i] == 0) continue;
    ans = (ans + choose(rs[i] + rs2[i] - 1, rs2[i] - 1)) % MOD;
  }
  printf("%I64d", ans);
}
