#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 199;
long long int fac[N], rev[N], mod = 1e9 + 7;
long long int wop(long long int x, long long int y) {
  if (y == 0) return 1;
  long long int ret = wop(x, y / 2);
  ret *= ret;
  ret %= mod;
  if (y & 1) ret *= x;
  return ret % mod;
}
long long int chos(long long int r, long long int n) {
  if (r > n || r < 0)
    return 0;
  else
    return (fac[n] * ((rev[r] * rev[n - r]) % mod)) % mod;
}
int main() {
  fac[0] = rev[0] = 1;
  for (long long int i = 1; i <= 3e5; i++) {
    fac[i] = fac[i - 1] * i;
    fac[i] %= mod;
    rev[i] = wop(fac[i], mod - 2);
  }
  string s;
  cin >> s;
  long long int op = 0, cl = 0, ans = 0;
  for (int i = 0; i < s.size(); i++)
    if (s[i] == ')') cl++;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == ')') {
      cl--;
      ans += chos(cl + 1, cl + op);
      ans %= mod;
    } else
      op++;
  }
  cout << ans;
}
