#include <bits/stdc++.h>
using namespace std;
const long long nmax = 705, mod = 1e9 + 7;
long long dp[nmax][2][2];
long long charval[300];
long long solve(string expr, bool nested) {
  if (expr.size() == 0) return 1;
  long long ans = 1;
  long long n = 0, sum = 0;
  string cur;
  for (long long i = 0; i < expr.size(); ++i) {
    cur.push_back(expr[i]);
    sum += charval[expr[i]];
    if (sum == 0) {
      ans *= solve(cur.substr(1, cur.size() - 2), 1);
      ans %= mod;
      cur.resize(0);
      n++;
    }
  }
  long long mult;
  if (nested)
    mult = dp[n][0][1] + dp[n][0][0] + dp[n][1][0] / 2 + dp[n][1][1] / 2;
  else
    mult = (dp[n][0][0] + dp[n][0][1] + dp[n][1][0] + dp[n][1][1]);
  return (ans * (mult % mod)) % mod;
}
int main() {
  charval['('] = 1;
  charval[')'] = -1;
  dp[1][0][1] = 2;
  dp[1][1][0] = 2;
  for (long long i = 2; i < nmax; ++i) {
    dp[i][0][0] += 2 * dp[i - 1][0][0] + dp[i - 1][0][1];
    dp[i][0][1] += 2 * dp[i - 1][0][1] + 2 * dp[i - 1][0][0];
    dp[i][1][0] += 2 * dp[i - 1][1][0] + dp[i - 1][1][1];
    dp[i][1][1] += 2 * dp[i - 1][1][1] + 2 * dp[i - 1][1][0];
    dp[i][0][0] %= mod;
    dp[i][0][1] %= mod;
    dp[i][1][0] %= mod;
    dp[i][1][1] %= mod;
  }
  string expr;
  cin >> expr;
  cout << solve(expr, 0) << '\n';
}
