#include <bits/stdc++.h>
using namespace std;
vector<long long> fact;
long long gcdExtended(long long a, long long b, long long *x, long long *y);
long long modInverse(long long b, long long m) {
  long long x, y;
  long long g = gcdExtended(b, m, &x, &y);
  if (g != 1) return -1;
  return (x % m + m) % m;
}
long long modDivide(long long a, long long b, long long m) {
  a = a % m;
  long long inv = modInverse(b, m);
  return (inv * a) % m;
}
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long ncr(long long a, long long b) {
  return modDivide(fact[a], (fact[b] * fact[a - b]) % 1000000007, 1000000007);
}
int main() {
  iostream::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s;
  cin >> s;
  long long cnt1 = 0, cnt2 = 0;
  vector<long long> a1, a2;
  fact.push_back(1ll * 1);
  for (long long i = (0); i < (s.length()); ++i) {
    if (s[i] == '(')
      cnt1++;
    else
      cnt2++;
  }
  long long c1 = 0, c2 = 0;
  for (long long i = (0); i < (s.length()); ++i) {
    if (s[i] == '(') {
      c1++;
    } else {
      c2++;
      a1.push_back(c1);
      a2.push_back(cnt2 - c2 + 1);
    }
  }
  for (long long i = (1); i < (cnt1 + cnt2 + 1); ++i)
    fact.push_back((fact.back() * i) % 1000000007);
  long long ans = 0;
  for (long long i = (0); i < (a1.size()); ++i) {
    if (a1[i] != 0)
      ans = (ans + ncr(a1[i] + a2[i] - 1, a1[i] - 1)) % 1000000007;
  }
  cout << ans;
}
