#include <bits/stdc++.h>
using namespace std;
const string TASK = "";
const int mod = 1e9 + 7;
string s;
int l, r, res;
long long P[200001];
void Enter() { cin >> s; }
void Init() {
  l = r = 0;
  P[0] = 1;
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == ')') ++r;
    P[i + 1] = P[i] * (i + 1) % mod;
  }
}
long long Pow(int a, int b) {
  if (b == 0) return 1;
  long long t = Pow(a, b / 2);
  t = t * t % mod;
  if (b % 2) return t * a % mod;
  return t;
}
long long C(int n, int k) {
  return P[n] * Pow(P[k] * P[n - k] % mod, mod - 2) % mod;
}
void Solve() {
  for (int i = 0; i < s.size(); ++i) {
    if (s[i] == '(')
      ++l;
    else {
      if (l != 0 && r != 0) res = (res + C(l + r - 1, r)) % mod;
      --r;
    }
  }
  cout << res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  Enter();
  Init();
  Solve();
}
