#include <bits/stdc++.h>
using namespace std;
const int N = 4e5 + 7;
const int M = 1e9 + 7;
int fact[N];
int rfact[N];
int c(int n, int k) {
  return ((fact[n] * (long long)rfact[k]) % M * (long long)rfact[n - k]) % M;
}
int bin(int a, int n) {
  if (n == 0) {
    return 1;
  }
  if (n % 2 == 0) {
    int t = bin(a, n / 2);
    return (t * (long long)t) % M;
  } else {
    int t = bin(a, n - 1);
    return (t * (long long)a) % M;
  }
}
int main() {
  fact[0] = 1;
  rfact[0] = 1;
  for (int i = 1; i < N; i++) {
    fact[i] = (fact[i - 1] * (long long)i) % M;
    rfact[i] = bin(fact[i], M - 2);
  }
  ios::sync_with_stdio(0);
  string s;
  cin >> s;
  int n = s.size();
  vector<int> suf(n + 1);
  for (int i = n - 1; i >= 0; i--) {
    suf[i] = suf[i + 1] + (s[i] == ')');
  }
  int ans = 0;
  int res = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == '(') {
      res++;
      ans = (ans + c(res + suf[i + 1] - 1, res)) % M;
    }
  }
  cout << ans << '\n';
}
