#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  long long f[200005] = {1}, g[200005] = {}, z = 0;
  int a[200005] = {}, b[200005] = {};
  g[200000] = 750007460;
  for (int i = 1; i <= 200000; i++) f[i] = f[i - 1] * i % mod;
  for (int i = 199999; i >= 0; i--) g[i] = g[i + 1] * (i + 1) % mod;
  string s;
  cin >> s;
  for (int i = 1; i <= s.length(); i++) a[i] = a[i - 1] + (s[i - 1] == '(');
  for (int i = (int)s.length(); i; i--) b[i] = b[i + 1] + (s[i - 1] == ')');
  for (int i = 1; i < s.length(); i++)
    if (s[i - 1] == '(' && b[i + 1]) {
      z += f[a[i] + b[i + 1] - 1] * g[b[i + 1] - 1] % mod * g[a[i]] % mod;
    }
  cout << z % mod;
}
