#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int N;
string s;
long long fact[200005], invFact[200005], sol, open[200005], closed[200005];
long long lgpow(long long base, long long exp) {
  long long res = 1;
  while (exp) {
    if (exp & 1) {
      res *= base;
      res %= mod;
    }
    exp /= 2;
    base *= base;
    base %= mod;
  }
  return res;
}
long long comb(int n, int k) {
  return (((fact[n] * invFact[k]) % mod) * invFact[n - k]) % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> s;
  N = s.size();
  fact[0] = 1;
  for (int i = 1; i <= N; ++i) {
    fact[i] = (fact[i - 1] * i) % mod;
  }
  invFact[N] = lgpow(fact[N], mod - 2);
  for (int i = N - 1; i >= 0; --i) {
    invFact[i] = (invFact[i + 1] * (i + 1)) % mod;
  }
  open[0] = (s[0] == '(');
  closed[s.size() - 1] = (s[s.size() - 1] == ')');
  for (int i = 1; i < (int)s.size(); ++i) {
    open[i] = open[i - 1] + (s[i] == '(');
  }
  for (int i = N - 2; i >= 0; --i) {
    closed[i] = closed[i + 1] + (s[i] == ')');
  }
  for (int i = 0; i < N; ++i) {
    if (s[i] == '(') {
      sol += comb(open[i] + closed[i] - 1, open[i]);
      sol %= mod;
    }
  }
  cout << sol << '\n';
  return 0;
}
