#include<iostream>
#include<vector>
using namespace std;

// Finite field Z/pZ
class ModInt{
private:
  long long val;
  static const int default_mod = 1e9 + 7;
  static int mod;
public:
  ModInt(long long val)
  {
    this->val = val % getMod();
    if(this->val < 0){
      this->val += getMod();
    }
  }
  ModInt()
    : ModInt(0)
  {
  }
  static void setMod(int mod){
    if(ModInt::mod != 0){
      throw "The modulo is already set.";
    }
    ModInt::mod = mod;
  }
  inline static int getMod(){
    if(mod == 0){
      mod = default_mod;
    }
    return mod;
  }
  inline long long getVal() const{
    return val;
  }

  
  ModInt& operator+=(const ModInt&);
  ModInt& operator-=(const ModInt&);
  ModInt& operator*=(const ModInt&);
  ModInt& operator/=(const ModInt&);

  ModInt pow(long long exponent) const{
    exponent %= getMod() - 1;
    long long pow_val = this->val;
    long long ret_val = 1;
    while(exponent > 0){
      if(exponent % 2 == 1){
        ret_val = (ret_val * pow_val) % getMod();
      }
      pow_val = (pow_val * pow_val) % getMod();
      exponent /= 2;
    }
    return ModInt(ret_val);
  }
  ModInt inv() const{
    return this->pow(getMod() - 2);
  }
  friend ostream& operator<< (ostream& os, const ModInt& modint){
    os << modint.val;
    return os;
  }
  friend istream& operator>>(istream& is, ModInt& modint){
    long long val;
    is >> val;
    modint.val = val % modint.getMod();
    return is;
  }
};

int ModInt::mod = 0;

const ModInt operator+(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs.getVal() + rhs.getVal());
}
const ModInt operator-(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs.getVal() - rhs.getVal());
}
const ModInt operator*(const ModInt& lhs, const ModInt& rhs){
  return ModInt(lhs.getVal() * rhs.getVal());
}
const ModInt operator/(const ModInt& lhs, const ModInt& rhs){
  return lhs.getVal() * rhs.inv();
}


ModInt& ModInt::operator+=(const ModInt& rhs){
  (*this) = (*this) + rhs;
  return *this;
}
ModInt& ModInt::operator-=(const ModInt& rhs){
  (*this) = (*this) - rhs;
  return *this;
}
ModInt& ModInt::operator*=(const ModInt& rhs){
  (*this) = (*this) * rhs;
  return *this;
}
ModInt& ModInt::operator/=(const ModInt& rhs){
  (*this) = (*this) / rhs;
  return *this;
}

class ModIntComb{
private:
  vector<ModInt> facts;
  vector<ModInt> fact_invs;
  int n_max;
public:
  ModIntComb(int n_max): n_max(n_max){
    facts.push_back(1);
    for(int i = 1; i <= n_max; i++){
      facts.push_back(facts[i - 1] * i);
    }
    fact_invs = vector<ModInt>(n_max + 1);
    fact_invs[n_max] = facts[n_max].inv();
    for(int i = n_max - 1; i >= 0; i--){
      fact_invs[i] = fact_invs[i + 1] * (i + 1);
    }
  }
  int getNMax(){
    return n_max;
  }
  ModInt fact(int n){
    return facts[n];
  }
  ModInt fact_inv(int n){
    return fact_invs[n];
  }
  ModInt comb(int n, int k){
    if(k < 0 || k > n){
      return 0;
    }
    return facts[n] * fact_invs[k] * fact_invs[n - k];
  }
};

int main(){
  int N;
  cin >> N;
 
  string s;
  cin >> s;
 
  vector<vector<ModInt>> dp(N, vector<ModInt>(N));
  for(int j = 0; j < N; j++){
    dp[0][j] = 1;
  }
 
  for(int i = 1; i < N; i++){
    vector<ModInt> dp_sum(N - (i - 1) + 1);
    for(int j = 1; j <= N - (i - 1); j++){
      dp_sum[j] = dp_sum[j - 1] + dp[i - 1][j - 1];
    }
    for(int j = 0; j < N - i; j++){
      if(s[i - 1] == '<'){
        dp[i][j] = dp_sum[j + 1];
      }else{
        dp[i][j] = dp_sum[N - (i - 1)] - dp_sum[j + 1];
      }
    }
  }
 
  cout << dp[N - 1][0] << endl;
}


Measured memory_bytes: 70656