#include <bits/stdc++.h>
using namespace std;
long long int f[500000], inv[500000];
long long int mpow(long long int a, long long int n,
                   long long int m = 1000000007) {
  a %= m;
  long long int r = 1;
  while (n) {
    if (n & 1) r = (r * a) % m;
    a = (a * a) % m;
    n >>= 1;
  }
  return r;
}
void init() {
  f[0] = inv[0] = 1;
  for (int i = 1; i < 500000; ++i) {
    f[i] = (1LL * i * f[i - 1]) % 1000000007;
    inv[i] = mpow(f[i], 1000000007 - 2);
  }
}
long long int C(int n, int r) {
  long long int ret = f[n];
  ret = (ret * inv[r]) % 1000000007;
  ret = (ret * inv[n - r]) % 1000000007;
  return ret;
}
int main(void) {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  init();
  string s;
  cin >> s;
  int n = s.size();
  int open = 0, closed = 0;
  for (auto it : s) {
    if (it == ')') ++closed;
  }
  long long int ans = 0;
  if (closed == 0 or closed == n) {
    cout << 0 << '\n';
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    if (s[i] == ')') {
      --closed;
      if (closed == 0) break;
      continue;
    }
    long long int add = 0;
    if (open <= closed) {
      add = C(open + closed, open + 1);
    } else {
      add = C(open + closed, closed - 1);
    }
    ans = (ans + add) % 1000000007;
    if (s[i] == '(') ++open;
  }
  cout << ans << '\n';
}
