#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e15;
const long long int mod = 1000000007;
const int infInt = 1e9;
const double PI = acos(-1.00);
const double eps = 1e-6;
long long int exp(long long int b, long long int e) {
  long long int res = 1;
  for (; e > 0; e >>= 1) {
    if (e & 1) res = res * b % mod;
    b = b * b % mod;
  }
  return res;
}
long long int inv(long long int a) { return exp(a, mod - 2); }
long long int fact[400100];
long long int comb(long long int n, long long int k) {
  if (k > n) return 0LL;
  long long int num = fact[n];
  long long int den = (fact[k] * fact[n - k]) % mod;
  return (num * inv(den)) % mod;
}
long long int fil[] = {-1, 0, 1, 0};
long long int col[] = {0, 1, 0, -1};
long long int n, m;
vector<long long int> v;
string s;
long long int a[200010];
long long int b[200010];
int len;
vector<vector<int> > adj;
int main() {
  cin.sync_with_stdio(false);
  cin.tie(NULL);
  fact[0] = 1LL;
  for (long long int i = 1; i <= 400000; i++) {
    fact[i] = (i * fact[i - 1]) % mod;
  }
  cin >> s;
  len = s.size();
  for (int i = 0; i < len; i++) {
    a[i] = (s[i] == '(') ? 1 : 0;
    if (i > 0) a[i] += a[i - 1];
  }
  for (int i = len - 1; i >= 0; i--) {
    b[i] = (s[i] == ')') ? 1 : 0;
    b[i] += b[i + 1];
  }
  long long int ans = 0;
  for (long long int i = 0; i < len - 1; i++) {
    if (i == 0) {
      ans += (a[i] * b[i + 1]);
      continue;
    }
    if (a[i] > a[i - 1]) {
      ans = (ans + b[i + 1]) % mod;
      if (b[i + 1]) {
        long long int aux = (b[i + 1] > a[i])
                                ? comb(a[i] - 1 + b[i + 1], a[i])
                                : comb(a[i] - 1 + b[i + 1], b[i + 1] - 1);
        long long int aux2 = (comb(a[i] - 1, 0) * comb(b[i + 1], 1)) % mod;
        ans = (ans + aux - aux2) % mod;
        if (ans < 0) ans += mod;
      }
    }
  }
  cout << ans << "\n";
}
