#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000000 + 7;
char s[200010];
int suml[200010], sumr[200010];
long long int c[200010];
long long int ans;
void init() {
  c[0] = 1;
  for (int i = 1; i <= 200010; i++) {
    c[i] = c[i - 1] * i % mod;
  }
}
int Pow(int t, int k) {
  long long int ans = 1;
  if (k == 0) return 1;
  long long int T = Pow(t, k / 2);
  ans = ans * T % mod * T % mod;
  if (k % 2 == 1) {
    ans = ans * t % mod;
  }
  return (int)ans;
}
long long int C(int n, int m) {
  return c[n] * Pow(c[n - m], mod - 2) % mod * Pow(c[m], mod - 2) % mod;
}
int main() {
  int i, j, k;
  scanf("%s", s + 1);
  int l = strlen(s + 1);
  init();
  for (i = 1; i <= l; i++) {
    if (s[i] == '(') {
      suml[i] = suml[i - 1] + 1;
    } else {
      suml[i] = suml[i - 1];
    }
  }
  for (i = l; i >= 1; i--) {
    if (s[i] == ')') {
      sumr[i] = sumr[i + 1] + 1;
    } else {
      sumr[i] = sumr[i + 1];
    }
  }
  ans = 0;
  for (i = 1; i <= l; i++) {
    if (s[i] == '(') ans = (ans + C(suml[i] + sumr[i] - 1, sumr[i] - 1)) % mod;
  }
  printf("%I64d", ans);
  return 0;
}
