#include <bits/stdc++.h>
using namespace std;
typedef struct {
  int sum, suf, pre, max;
} Node;
int toint(const string &s) {
  stringstream ss;
  ss << s;
  int x;
  ss >> x;
  return x;
}
const int MAXN = 2e5 + 100;
const int UP = 31;
const long long int highest = 1e18;
const double pi = acos(-1);
const double Phi = 1.618033988749894;
const int logn = 20;
const double root5 = 2.236067977;
const int inf = 1e9;
const int INF = 1000000000;
const int ini = -1e9;
const int N = 2e5 + 10;
const long long int mod = 1e9 + 7;
long long int fact[N];
long long int ifac[N];
string s;
int n;
long long int op[N], cls[N];
long long int bp(long long int a, long long int p) {
  if (p == 0)
    return 1;
  else if (p & 1)
    return a * bp(a * a % mod, p >> 1) % mod;
  else
    return bp(a * a % mod, p >> 1);
}
long long int mul(long long int a, long long int b) {
  return (a % mod * 1LL * b % mod) % mod;
}
void add_self(long long int &a, long long int b) {
  a += b;
  if (a >= mod) a -= mod;
}
void init() {
  fact[0] = 1;
  for (int i = 1; i < N; ++i) {
    fact[i] = mul(fact[i - 1], i);
  }
  ifac[N - 1] = bp(fact[N - 1], mod - 2);
  for (int i = N - 2; i >= 0; --i) {
    ifac[i] = mul(ifac[i + 1], i + 1);
  }
}
long long int C(long long int x, long long int y) {
  long long int num = fact[x];
  long long int denom = mul(ifac[x - y], ifac[y]);
  return mul(num, denom);
}
int main() {
  init();
  cin >> s;
  n = s.length();
  op[0] = (s[0] == '(') ? 1 : 0;
  for (int i = 1; i < n; ++i) {
    if (s[i] == '(') {
      op[i] = op[i - 1] + 1;
    } else {
      op[i] = op[i - 1];
    }
  }
  cls[n - 1] = (s[n - 1] == ')') ? 1 : 0;
  for (int i = n - 2; i >= 0; --i) {
    if (s[i] == ')') {
      cls[i] = cls[i + 1] + 1;
    } else {
      cls[i] = cls[i + 1];
    }
  }
  long long int ans = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] != '(' || cls[i] == 0) {
      continue;
    }
    add_self(ans, C(op[i] + cls[i] - 1, op[i]));
  }
  cout << ans << endl;
  return 0;
}
