#include <bits/stdc++.h>
#define int long long int
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;

struct edge { int to, cost; };

const int INF = 1e18;
const int MOD = 1e9+7;

template<int mod=MOD>
struct ModRing {
   int x;
   ModRing(int a=0) { x = ((a % mod) + mod) % mod; }

   ModRing& operator=(const ModRing& a) & = default;

   ModRing operator+() const { return ModRing(x); }
   ModRing operator-() const { return ModRing((-x + mod) % mod); }

   ModRing power(int n) const {
      ModRing tmp = *this, res = 1;
      while (n > 0) { if ((n & 1) == 1) res *= tmp; tmp *= tmp; n >>= 1; }
      return res;
   }

   ModRing& operator+=(const ModRing& a) { (x += a.x) %= mod; return *this; }
   ModRing& operator-=(const ModRing& a) { return *this += -a; }
   ModRing& operator*=(const ModRing& a) { (x *= a.x) %= mod; return *this; }

   ModRing& operator++() { return *this += 1; }
   ModRing& operator--() { return *this -= 1; }
};
template<int mod=MOD, typename T> const ModRing<mod> operator+(const ModRing<mod>& a, const T& b) { return ModRing<mod>(a) += b; }
template<int mod=MOD, typename T> const ModRing<mod> operator-(const ModRing<mod>& a, const T& b) { return ModRing<mod>(a) -= b; }
template<int mod=MOD, typename T> const ModRing<mod> operator*(const ModRing<mod>& a, const T& b) { return ModRing<mod>(a) *= b; }
template<int mod=MOD> bool operator<(const ModRing<mod>& a, const ModRing<mod>& b) { return a.x < b.x; }
template<int mod=MOD> bool operator>(const ModRing<mod>& a, const ModRing<mod>& b) { return b < a; }
template<int mod=MOD> bool operator<=(const ModRing<mod>& a, const ModRing<mod>& b) { return !(a > b); }
template<int mod=MOD> bool operator>=(const ModRing<mod>& a, const ModRing<mod>& b) { return !(a < b); }
template<int mod=MOD> bool operator==(const ModRing<mod>& a, const ModRing<mod>& b) { return !(a < b) && !(a > b); }
template<int mod=MOD> bool operator!=(const ModRing<mod>& a, const ModRing<mod>& b) { return !(a == b); }
template<int mod=MOD> bool operator<(const ModRing<mod>& a, int b) { return a < ModRing<mod>(b); }
template<int mod=MOD> bool operator>(const ModRing<mod>& a, int b) { return a > ModRing<mod>(b); }
template<int mod=MOD> bool operator<=(const ModRing<mod>& a, int b) { return a <= ModRing<mod>(b); }
template<int mod=MOD> bool operator>=(const ModRing<mod>& a, int b) { return a >= ModRing<mod>(b); }
template<int mod=MOD> bool operator==(const ModRing<mod>& a, int b) { return a == ModRing<mod>(b); }
template<int mod=MOD> bool operator!=(const ModRing<mod>& a, int b) { return a != ModRing<mod>(b); }

template<int mod>auto&operator<<(ostream&s,const ModRing<mod>&a){s<<a.x;return s;}

template<int mod=MOD>
struct FiniteField : ModRing<mod> {
   FiniteField(int a=0) : ModRing<mod>(a) {}
   FiniteField(const ModRing<mod>& a) : ModRing<mod>(a) {}

   FiniteField& operator=(const FiniteField& a) & = default;

   FiniteField operator+() const { return ModRing<mod>::operator+(); }
   FiniteField operator-() const { return ModRing<mod>::operator-(); }

   FiniteField power(int n) const { return ModRing<mod>::power(n); }

   FiniteField& operator+=(const FiniteField& a) { return *this = ModRing<mod>::operator+=(a); }
   FiniteField& operator-=(const FiniteField& a) { return *this = ModRing<mod>::operator-=(a); }
   FiniteField& operator*=(const FiniteField& a) { return *this = ModRing<mod>::operator*=(a); }

   FiniteField& operator++() { return *this = ModRing<mod>::operator++(); }
   FiniteField& operator--() { return *this = ModRing<mod>::operator--(); }

   FiniteField inverse() const {
      try { if (this->x == 0) throw "0 have no inverse"; }
      catch (const char* e) { cerr << e << endl; }
      return power(mod-2);
   }
   FiniteField& operator/=(const FiniteField& a) { return *this = (*this *= a.inverse()); }
};

template<int mod=MOD, typename T> const FiniteField<mod> operator+(const FiniteField<mod>& a, const T& b) { return FiniteField<mod>(a) += b; }
template<int mod=MOD, typename T> const FiniteField<mod> operator-(const FiniteField<mod>& a, const T& b) { return FiniteField<mod>(a) -= b; }
template<int mod=MOD, typename T> const FiniteField<mod> operator*(const FiniteField<mod>& a, const T& b) { return FiniteField<mod>(a) *= b; }
template<int mod=MOD, typename T> const FiniteField<mod> operator/(const FiniteField<mod>& a, T& b) { return FiniteField<mod>(a) /= b; }

signed main()
{
   int n; cin >> n;
   string s; cin >> s;

   using GF = FiniteField<>;
   V<V<GF>> dp(n, V<GF>(n)), sum(n, V<GF>(n+1));
   dp[0][0] = 1;
   for (int j = 0; j < n; j++) {
      sum[0][j+1] = sum[0][j] + dp[0][j];
   }
   for (int i = 0; i < n-1; i++) {
      for (int j = 0; j <= i+1; j++) {
         if (s[i] == '<') {
            // for (int k = 0; k < j; k++) {
            //    dp[i+1][j] += dp[i][k];
            // }
            dp[i+1][j] = sum[i][j] - sum[i][0];
         } else {
            // for (int k = j; k <= i+1; k++) {
            //    dp[i+1][j] += dp[i][k];
            // }
            dp[i+1][j] = sum[i][i+2] - sum[i][j];
         }
      }
      for (int j = 0; j < n; j++) {
         sum[i+1][j+1] = sum[i+1][j] + dp[i+1][j];
      }
   }
   GF ans = accumulate(dp[n-1].begin(), dp[n-1].end(), GF(0));
   cout << ans << endl;

   return 0;
}


Measured memory_bytes: 141184