#include <bits/stdc++.h>
using namespace std;
const int N = int(300000) + 5;
long long int k, n, t, m, cnt, sum, ans, x;
long long int a[N], fact[N];
void pre() {
  fact[0] = 1;
  for (long long int i = 1; i <= 300000; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
}
long long int pow(long long int a, long long int b, long long int MOD) {
  long long int x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y);
      if (x > MOD) x %= MOD;
    }
    y = (y * y);
    if (y > MOD) y %= MOD;
    b /= 2;
  }
  return x;
}
long long int inv(long long int n) {
  return pow(n, 1000000007 - 2, 1000000007);
}
long long int ncr(long long int n, long long int r) {
  return ((fact[n] * inv(fact[r])) % 1000000007 * inv(fact[n - r])) %
         1000000007;
}
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  pre();
  cin >> s;
  n = s.length();
  for (long long int i = 0; i <= n - 1; i++) {
    if (s[i] == ')') cnt++;
  }
  for (long long int i = 0; i <= n - 1; i++) {
    if (s[i] == ')') cnt--;
    if (s[i] == '(') {
      ans = (ans + ncr(cnt + sum, cnt - 1)) % 1000000007;
      sum++;
    }
  }
  cout << ans;
  return 0;
}
