#include <bits/stdc++.h>
using namespace std;
long long int mod = 1000000007;
long long int fact[200001];
long long int power(long long int a, long long int b) {
  if (b) {
    long long int z = power(a, b / 2);
    if (b % 2)
      return (((z * z) % mod) * a) % mod;
    else
      return (z * z) % mod;
  }
  return 1;
}
long long int modinv(long long int a) { return power(a, mod - 2); }
long long int func(long long int a, long long int b) {
  long long int temp = (fact[b] * fact[a - b]) % mod;
  long long int ans = (fact[a] * modinv(temp)) % mod;
  return ans;
}
int main() {
  fact[0] = 1;
  for (long long int i = 1; i <= 200000; i++) fact[i] = (fact[i - 1] * i) % mod;
  string s;
  cin >> s;
  long long int n = s.size();
  vector<long long int> a(n), b(n);
  a[0] = s[0] == '(' ? 1 : 0;
  for (long long int i = 1; i < n; i++) {
    if (s[i] == '(')
      a[i] = a[i - 1] + 1;
    else
      a[i] = a[i - 1];
  }
  b[n - 1] = s[n - 1] == ')' ? 1 : 0;
  for (long long int i = n - 2; i >= 0; i--) {
    if (s[i] == ')')
      b[i] = b[i + 1] + 1;
    else
      b[i] = b[i + 1];
  }
  long long int res = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(' && b[i] != 0) {
      long long int c = func(a[i] + b[i] - 1, a[i]);
      res = (res + c) % mod;
    }
  }
  cout << res << endl;
  return 0;
}
