#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 50;
const int oo = 1e9;
const int mod = 1e9 + 7;
long long f[2 * N], inv[2 * N];
long long Power(long long a, long long b) {
  if (b == 0) return 1;
  long long ret = Power(a, b / 2);
  if (b % 2 != 0) return ((ret * ret) % mod * a) % mod;
  return (ret * ret) % mod;
}
long long nCk(long long n, long long k) {
  return ((f[n] * inv[k]) % mod * inv[n - k]) % mod;
}
int main() {
  f[0] = 1;
  inv[0] = Power(1, mod - 2);
  for (int i = 1; i < 2 * N; i++) {
    f[i] = (f[i - 1] * i) % mod;
    inv[i] = Power(f[i], mod - 2);
  }
  string s;
  cin >> s;
  long long c = 0, o = 0, ans = 0;
  for (int i = 0; i < s.length(); i++) c += (s[i] == ')');
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == '(' && c > 0) {
      o++;
      ans = (ans + nCk(o + c - 1, o) % mod) % mod;
    } else if (s[i] == ')')
      c--;
  }
  cout << ans << endl;
}
