#include <bits/stdc++.h>
int mm = 20000;
using namespace std;
long long exp(long int a, long int i) {
  if (i == 0) return 1;
  if (i == 1) return a;
  auto t = exp(a, i / 2);
  return (((t * t) % 1000000007) * (i % 2 == 0 ? 1 : a)) % 1000000007;
}
vector<long long> f;
vector<long long> d;
void comp(int n) {
  f.resize(n + 10);
  d.resize(n + 10);
  d[0] = 1;
  d[1] = 1;
  f[0] = 1;
  f[1] = 1;
  for (int i = 2; i <= n; ++i) {
    f[i] = ((f[i - 1] * exp(i, 1000000007 - 2)) % 1000000007);
    d[i] = (d[i - 1] * i) % 1000000007;
  }
}
int main() {
  string s;
  cin >> s;
  int n = s.size();
  comp(n);
  vector<pair<int, int> > v(n);
  v[0].first = (s[0] == '(');
  v[n - 1].second = (s[n - 1] == ')');
  for (int i = 1; i < n; ++i) {
    v[i].first = v[i - 1].first + (s[i] == '(');
    v[n - i - 1].second = v[n - i].second + (s[n - i - 1] == ')');
  }
  long long res = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == ')') continue;
    int k1 = v[i].first - 1;
    int k2 = v[i].second;
    if (k2 == 0) continue;
    long long t = (d[k1 + k2] * f[k2 - 1]) % 1000000007;
    t = (t * f[k1 + 1]) % 1000000007;
    res = (res + t) % 1000000007;
  }
  cout << res << endl;
  return 0;
}
