#include <bits/stdc++.h>
using namespace std;
class Solution {
 public:
  int count(string& s, int n) {
    vector<int> tb;
    buildTable(s, tb);
    int m = s.length();
    vector<vector<int>> nxt(m + 1, vector<int>(2, 0));
    string ps = "()";
    for (int i = 0; i < m; ++i) {
      for (auto c : ps) {
        int j = i;
        int k = c == '(' ? 0 : 1;
        while (j != -1 && s[j] != c) {
          j = tb[j];
        }
        if (j == -1) {
          nxt[i][k] = 0;
        } else {
          nxt[i][k] = j + 1;
        }
      }
    }
    nxt[m][0] = nxt[m][1] = m;
    vector<vector<vector<int>>> dp(
        2 * n + 1, vector<vector<int>>(n + 1, vector<int>(m + 1, 0)));
    dp[0][0][0] = 1;
    for (int i = 0; i < 2 * n; ++i) {
      for (int j = 0; j <= n; ++j) {
        for (int k = 0; k <= m; ++k) {
          if (dp[i][j][k] == 0) {
            continue;
          }
          if (j + 1 <= n) {
            dp[i + 1][j + 1][nxt[k][0]] =
                addM(dp[i + 1][j + 1][nxt[k][0]], dp[i][j][k]);
          }
          if (j - 1 >= 0) {
            dp[i + 1][j - 1][nxt[k][1]] =
                addM(dp[i + 1][j - 1][nxt[k][1]], dp[i][j][k]);
          }
        }
      }
    }
    return dp[2 * n][0][m];
  }

 private:
  const static int M = 1e9 + 7;
  long long addM(long long a, long long b) { return (a + b) % M; }
  long long mulM(long long a, long long b) { return (a * b) % M; }
  void buildTable(const string& s, vector<int>& tb) {
    int n = s.length();
    tb.resize(n + 1);
    fill(tb.begin(), tb.end(), 0);
    tb[0] = -1;
    for (int i = 0, j = -1; i < n; ++i) {
      while (j != -1 && s[j] != s[i]) {
        j = tb[j];
      }
      tb[i + 1] = ++j;
    }
  }
};
int main(int argc, char** argv) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  Solution sol;
  cout << sol.count(s, n) << endl;
  return 0;
}
