#include <bits/stdc++.h>
int dr[] = {2, 2, -2, -2, 1, -1, 1, -1};
int dc[] = {1, -1, 1, -1, 2, 2, -2, -2};
int dr1[] = {0, 0, 0, 1, 1, 1, -1, -1, -1};
int dc1[] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
int dr2[] = {0, 0, 1, -1};
int dc2[] = {1, -1, 0, 0};
using namespace std;
long long int b[200004], fr[200004];
long long int bigmod(long long int n, long long int p) {
  if (p == 0) return 1;
  long long int x = bigmod(n, p / 2);
  x = (x * x) % 1000000007;
  if (p % 2 == 1) x = (x * n) % 1000000007;
  return x;
}
void pre() {
  long long int n, i;
  fr[0] = 1;
  for (long long int i = 1; i < 200004; i++)
    fr[i] = (fr[i - 1] * i) % 1000000007;
}
long long int ncr(long long int n, long long int r) {
  long long int p = fr[n];
  long long int p1 = (fr[n - r] * fr[r]) % 1000000007;
  p1 = bigmod(p1, 1000000007 - 2);
  return (p * p1) % 1000000007;
}
int main() {
  string t;
  pre();
  long long int n, i, j;
  while (cin >> t) {
    long long int cn = 0;
    for (i = t.size() - 1; i >= 0; i--) {
      cn += (t[i] == ')');
    }
    long long int ans = 0;
    long long int cn1 = 0;
    for (i = 0; i < t.size(); i++) {
      if (t[i] == ')') {
        cn--;
        continue;
      }
      cn1++;
      long long int p = ncr(cn + cn1 - 1, cn1);
      ans += p;
      ans %= 1000000007;
    }
    cout << ans << endl;
  }
  return 0;
}
