#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const long long mod = 1e9 + 7;
long long fac[N], ifac[N];
void egcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1, y = 0;
  } else {
    egcd(b, a % b, x, y);
    x -= a / b * y;
    swap(x, y);
  }
}
long long inv_mod(long long a) {
  long long x, y;
  egcd(a, mod, x, y);
  return (x % mod + mod) % mod;
}
long long nCk(int n, int k) {
  if (n < k || n < 0 || k < 0) return 0;
  return ((fac[n] * ifac[k]) % mod) * ifac[n - k] % mod;
}
int main() {
  ios::sync_with_stdio(false);
  fac[0] = ifac[0] = 1;
  for (int i = 1; i < int(N); i++) fac[i] = (i * fac[i - 1]) % mod;
  for (int i = 1; i < int(N); i++) ifac[i] = inv_mod(fac[i]);
  string s;
  cin >> s;
  int t = s.size() - 1;
  int o = count(s.begin(), s.end(), '('), c = 1;
  while (t >= 0 && s[t] != ')') t--, o--;
  long long ans = o;
  for (int i = int(t) - 1; i >= int(1); i--) {
    if (s[i] == ')') {
      ans = (ans + nCk(++c + o - 1, o - 1)) % mod;
    } else
      o--;
  }
  cout << ans << endl;
  return 0;
}
