#include <bits/stdc++.h>
using namespace std;
long long fact[200010];
void precalc() {
  fact[0] = 1;
  for (int i = 1; i < 200010; i++) {
    fact[i] = (fact[i - 1] * i) % 1000000007;
  }
}
long long power(long long a, long long b, long long p) {
  if (b == 0) return 1;
  long long ret = power(a, b / 2, p);
  ret = (ret * ret) % p;
  if ((b % 2) == 1) ret = (ret * a) % p;
  return ret % p;
}
long long ncr(long long x, long long y) {
  if (x < y) return 0;
  long long ans = 1;
  ans = (ans * fact[x]) % 1000000007;
  ans = (ans * power(fact[y], 1000000007 - 2, 1000000007)) % 1000000007;
  ans = (ans * power(fact[x - y], 1000000007 - 2, 1000000007)) % 1000000007;
  return ans;
}
int main() {
  precalc();
  string str;
  cin >> str;
  long long cnt = 0, ans = 0, n, cnt1[200010], cnt2[200010];
  n = str.length();
  for (int i = 0; i < n; i++) {
    if (str[i] == '(') {
      cnt++;
    }
    cnt1[i] = cnt;
  }
  cnt = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (str[i] == ')') {
      cnt++;
    }
    cnt2[i] = cnt;
  }
  for (int i = 0; i < n - 1; i++) {
    if (str[i] == '(' && cnt1[i] + cnt2[i + 1] - 1 >= cnt1[i]) {
      ans += ncr(cnt1[i] + cnt2[i] - 1, cnt1[i]);
      if (ans >= 1000000007) {
        ans -= 1000000007;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
