#include <bits/stdc++.h>
using namespace std;
const int M = 400000;
const int MOD = 1e9 + 7;
long long c[400000 + 100];
void init() {
  c[0] = 1;
  for (int i = 1; i <= M; i++) c[i] = c[i - 1] * i % MOD;
}
long long int inv(long long int x, long long int m) {
  long long k = m - 2, ans = 1;
  while (k) {
    if (k & 1) ans = ans * x % MOD;
    x = x * x % MOD;
    k /= 2;
  }
  return ans;
}
string s;
int a[M + 200], b[M + 200];
long long int C(int m, int n) {
  int m1 = n - m;
  long long int ans = c[m] * c[m1] % MOD;
  ans = c[n] * inv(ans, MOD) % MOD;
  return ans;
}
int main() {
  init();
  cin >> s;
  int len = s.size();
  int ans = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == '(') {
      a[i] = ans;
      ans++;
    }
  }
  ans = 0;
  for (int i = len - 1; i >= 0; i--) {
    if (s[i] == ')') {
      ans++;
    } else
      b[i] = ans;
  }
  long long int sum = 0;
  for (int i = 0; i < len; i++) {
    if (s[i] == '(') {
      sum += C(b[i] - 1, a[i] + b[i]);
    }
    if (sum >= MOD) sum -= MOD;
  }
  cout << sum << endl;
}
