#include <bits/stdc++.h>
using namespace std;
static int tests;
long long gcd(long long a, long long b, long long &x, long long &y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long tx, ty;
  long long tgcd = gcd(b, a % b, tx, ty);
  x = ty;
  y = tx - a / b * ty;
  return tgcd;
}
long long mod_inv(long long n, long long mod) {
  long long x, y;
  long long gcd_val = gcd(n, mod, x, y);
  if (gcd_val != 1) return -1;
  return (x % mod + mod) % mod;
}
long long mod_div(long long num, long long denom, long long mod) {
  num = num % mod;
  long long inv = mod_inv(denom, mod);
  if (inv == -1) return inv;
  return (num * inv) % mod;
}
class factorial_generator {
  long long LMOD;
  unordered_map<int, long long> store;

 public:
  factorial_generator(long long mod, int maxN) {
    LMOD = mod;
    store.reserve(maxN);
  }
  long long get_factorial(int n) {
    if (n == 0) return 1;
    if (store.find(n) != store.end()) return store[n];
    long long ans = (n * get_factorial(n - 1)) % LMOD;
    store[n] = ans;
    return ans;
  }
};
factorial_generator fact_gen(1000000007, 200000 / 2);
long long comb(long long n, long long k) {
  long long num = fact_gen.get_factorial(n);
  long long denom =
      (fact_gen.get_factorial(k) * fact_gen.get_factorial(n - k)) % 1000000007;
  return mod_div(num, denom, 1000000007);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string inp;
  cin >> inp;
  int str_len = inp.size();
  vector<int> open_before, closed_after;
  open_before.reserve(str_len);
  closed_after.resize(str_len);
  if (inp[0] == '(')
    open_before.push_back(1);
  else
    open_before.push_back(0);
  for (int i = 1; i <= str_len - 1; i++) {
    int prev_val = open_before[i - 1];
    if (inp[i] == '(')
      open_before.push_back(prev_val + 1);
    else
      open_before.push_back(prev_val);
  }
  if (inp[str_len - 1] == ')')
    closed_after[str_len - 1] = 1;
  else
    closed_after[str_len - 1] = 0;
  for (int i = str_len - 2; i >= 0; i--) {
    if (inp[i] == ')')
      closed_after[i] = closed_after[i + 1] + 1;
    else
      closed_after[i] = closed_after[i + 1];
  }
  long long ans = 0;
  for (int i = 0; i <= str_len - 1; i++) {
    if (inp[i] == ')' && open_before[i] != 0) {
      ans =
          (ans + comb(open_before[i] + closed_after[i] - 1, closed_after[i])) %
          1000000007;
    }
  }
  cout << ans << endl;
  return 0;
}
