#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int n;
long long ans, l[200055], r[200055], fact[200055];
char s[200055];
long long POW(long long first, long long p) {
  if (p == 0) return 1;
  if (p == 1) return first;
  long long ret = POW(first, p / 2);
  ret = (ret * ret) % MOD;
  if (p % 2 == 1) ret = (ret * first) % MOD;
  return ret;
}
inline long long inv(long long first) { return POW(first, MOD - 2); }
long long C(long long n, long long r) {
  long long ret = fact[n];
  ret *= inv(fact[r]);
  ret %= MOD;
  ret *= inv(fact[n - r]);
  ret %= MOD;
  return ret;
}
int main() {
  fact[0] = 1;
  for (int i = 1; i <= 200000; i++)
    fact[i] = (fact[i - 1] * (long long)i) % MOD;
  scanf("%s", s + 1);
  n = strlen(s + 1);
  for (int i = 1; i <= n; i++) l[i] = l[i - 1] + (s[i] == '(');
  for (int i = n; i >= 1; i--) r[i] = r[i + 1] + (s[i] == ')');
  for (int i = 1; i <= n; i++)
    if (s[i] == '(') {
      long long first = l[i];
      long long second = r[i];
      ans += C(first + second, min(first, second));
      ans -= C(first - 1 + second, min(first - 1, second));
      ans %= MOD;
      if (ans < 0) ans += MOD;
    }
  printf("%lld\n", ans);
  return 0;
}
