#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& cout, vector<T> V) {
  cout << "[ ";
  for (auto v : V) cout << v << ' ';
  return cout << ']';
}
template <class L, class R>
ostream& operator<<(ostream& cout, pair<L, R> P) {
  return cout << '(' << P.first << ',' << P.second << ')';
}
long long int modpow(long long int a, long long int n,
                     long long int m = 1000000007) {
  long long int ans = 1;
  while (n) {
    if (n % 2) ans = ((long long)ans * a) % m;
    a = ((long long)a * a) % m;
    n /= 2;
  }
  return ans;
}
long long int inv(long long int a, long long int m = 1000000007) {
  return modpow(a, m - 2, m);
}
long long int fact[500000 + 1], ifact[500000 + 1];
void ini_fact() {
  fact[0] = ifact[0] = 1;
  for (long long int i = 1; i <= 500000; i++) {
    fact[i] = ((long long)fact[i - 1] * i) % 1000000007;
    ifact[i] = inv(fact[i]);
  }
}
long long int c(long long int n, long long int r) {
  return ((((long long)fact[n] * ifact[r]) % 1000000007) *
          (long long)ifact[n - r]) %
         1000000007;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ini_fact();
  string s;
  cin >> s;
  long long int n = s.size();
  long long int ans = 0;
  long long int a = 0, b = 0;
  for (long long int i = 0; i < (n); i++)
    if (s[i] == ')') b++;
  for (long long int i = 0; i < (n); i++) {
    if (s[i] == '(') {
      a++;
    } else {
      b--;
      continue;
    }
    long long int tans = c(a + b - 1, b - 1);
    ans = (ans + tans) % 1000000007;
  }
  if (ans < 0) ans += 1000000007;
  cout << ans << '\n';
  cerr << "Time : " << 1000 * (long double)clock() / (long double)CLOCKS_PER_SEC
       << "ms\n";
  ;
}
