import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int n = in.readInt();
            boolean[] isF = new boolean[n];
            for (int i = 0; i < n; i++) {
                isF[i] = in.readCharacter() == 'f';
            }
            FenwickTree[] fenwickTrees = new FenwickTree[n + 1];
            for (int i = 0; i < fenwickTrees.length; i++) {
                fenwickTrees[i] = new FenwickTree(n + 1);
            }
            fenwickTrees[n].add(0, 1);
            for (int idx = n - 1; idx >= 0; idx--) {
                for (int indentLevel = 0; indentLevel < n; indentLevel++) {
                    long fenwickRes;
                    if (isF[idx]) {
                        fenwickRes = fenwickTrees[idx + 1].get(indentLevel + 1, indentLevel + 1);
                    } else {
                        fenwickRes = fenwickTrees[idx + 1].get(0, indentLevel);
                    }
                    fenwickTrees[idx].add(indentLevel, fenwickRes % MiscUtils.MOD7);
                }
            }
            out.printLine(fenwickTrees[0].get(0, 0));
        }
    }
    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            return (char) c;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void printLine(long i) {
            writer.println(i);
        }
    }
    static class MiscUtils {
        public static final int MOD7 = (int) (1e9 + 7);
    }
    static class FenwickTree {
        private final long[] value;

        public FenwickTree(int size) {
            value = new long[size];
        }

        public long get(int from, int to) {
            return get(to) - get(from - 1);
        }

        private long get(int to) {
            to = Math.min(to, value.length - 1);
            long result = 0;
            while (to >= 0) {
                result += value[to];
                to = (to & (to + 1)) - 1;
            }
            return result;
        }

        public void add(int at, long value) {
            while (at < this.value.length) {
                this.value[at] += value;
                at = at | (at + 1);
            }
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskC solver = new TaskC();
    solver.solve(1, in, out);
    out.close();
  }

  static class TaskC {
    private long MOD = (long) (1e9 + 7);
    int[][] dp = new int[5001][5001];

    public void solve(int testNumber, InputReader in, PrintWriter out) {
      int n = in.nextInt();
      ArrayList<Character> commands = new ArrayList<>();

      for (int i = 0; i < n; i++) {
        char ch = in.next().charAt(0);
        commands.add(ch);
      }
      for (int a[] : dp) Arrays.fill(a, -1);

      out.println(count(0, commands, 0));

    }

    public int count(int index, ArrayList<Character> commands, int deepCount) {
      if (deepCount < 0) {
        return 0;
      }
      if (index == commands.size()) {
        return 1;
      } else {

        if (dp[index][deepCount] != -1) return dp[index][deepCount];
        long result = 0;
        char ch = commands.get(index);
        result = count(index, commands, deepCount - 1);
        if (ch == 's') {
          result += count(index + 1, commands, deepCount);
        } else {
          result += count(index + 1, commands, deepCount + 1);
          result -= count(index + 1, commands, deepCount);
        }
        if (result >= MOD) {
          result -= MOD;
        }
        if (result < 0) {
          result += MOD;
        }
        return dp[index][deepCount] = (int) result;
      }
    }

  }

  static class InputReader {
    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private InputReader.SpaceCharFilter filter;

    public InputReader(InputStream stream) {
      this.stream = stream;
    }

    public int read() {
      if (numChars == -1) {
        throw new InputMismatchException();
      }
      if (curChar >= numChars) {
        curChar = 0;
        try {
          numChars = stream.read(buf);
        } catch (IOException e) {
          throw new InputMismatchException();
        }
        if (numChars <= 0) {
          return -1;
        }
      }
      return buf[curChar++];
    }

    public int readInt() {
      int c = read();
      while (isSpaceChar(c)) {
        c = read();
      }
      int sgn = 1;
      if (c == '-') {
        sgn = -1;
        c = read();
      }
      int res = 0;
      do {
        if (c < '0' || c > '9') {
          throw new InputMismatchException();
        }
        res *= 10;
        res += c - '0';
        c = read();
      } while (!isSpaceChar(c));
      return res * sgn;
    }

    public String readString() {
      int c = read();
      while (isSpaceChar(c)) {
        c = read();
      }
      StringBuilder res = new StringBuilder();
      do {
        if (Character.isValidCodePoint(c)) {
          res.appendCodePoint(c);
        }
        c = read();
      } while (!isSpaceChar(c));
      return res.toString();
    }

    public boolean isSpaceChar(int c) {
      if (filter != null) {
        return filter.isSpaceChar(c);
      }
      return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
      return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public String next() {
      return readString();
    }

    public int nextInt() {
      return readInt();
    }

    public interface SpaceCharFilter {
      public boolean isSpaceChar(int ch);

    }

  }
}


import java.io.*;
import java.util.StringTokenizer;

public class Main {
    BufferedReader br;
    PrintWriter pw;
    StringTokenizer st;
    long mod = (long) (1e9 + 7);

    public static void main(String[] args) {
        (new Main()).run();
    }

    void solve() throws IOException {
        int n = nextInt();
        boolean p[] = new boolean[n];
        for (int i = 0; i < n; i++) {
            String s = nextToken();
            if (s.charAt(0) == 'f') p[i] = true;
        }
        long d[][] = new long[n][n];
        d[0][0] = 1;
        for (int i = 1; i < n; i++) {
            if (p[i - 1]) {
                d[i][0] = 0;
                for (int j = 1; j < n; j++) {
                    d[i][j] = d[i - 1][j - 1];
                }
            } else {
                long sum = 0;
                for (int j = n - 1; j >= 0; j--) {
                    sum += d[i - 1][j];
                    sum %= mod;
                    d[i][j] = sum;
                }
            }
        }
        long sum = 0;
        for (int i = 0; i < n; i++) {
            sum += d[n - 1][i];
            sum %= mod;
        }
        pw.print(sum);
    }

    void run() {
        try {
//            br = new BufferedReader(new FileReader("divljak.in"));
//            pw = new PrintWriter(new BufferedWriter(new FileWriter("divljak.out")));
//            br = new BufferedReader(new FileReader("input.txt"));
//            pw = new PrintWriter(new FileWriter("output.txt"));
            br = new BufferedReader(new InputStreamReader(System.in));
            pw = new PrintWriter(new OutputStreamWriter(System.out));

            solve();
            pw.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    class h {
        int ans;
        int last;

        public h() {
            last = -1;
            ans = 0;
        }
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;

public class CFC {

    BufferedReader br;
    PrintWriter out;
    StringTokenizer st;
    boolean eof;
    final long MOD = 1000L * 1000L * 1000L + 7;
    int[] dx = {0, -1, 0, 1};
    int[] dy = {1, 0, -1, 0};

    void solve() throws IOException {
        int n = nextInt();
        long[] dp0 = new long[10 + n];
        long[] dp1 = new long[10 + n];
        long[] pre = new long[10 + n];
        dp0[0] = 1;
        String[] arr = new String[n];
        for (int i = 0; i < n; i++) {
            arr[i] = nextString();
        }
        String s = "s";
        for (int i = 0; i < n; i++) {
            Arrays.fill(dp1, 0);

            if (i == 0) {
                dp0[0] = 1;
                dp1[0] = 1;
            }
            else {
                if (arr[i - 1].equals(s)) {
                    for (int j = 0; j <= n + 5; j++) {
                        dp1[j] = pre[j];
                    }
                }
                else {
                    for (int j = 1; j <= n + 5; j++) {
                        dp1[j] = dp0[j - 1];
                    }
                }
            }

            Arrays.fill(pre, 0);
            pre[n + 5] = dp1[n + 5];
            for (int j = n + 4; j >= 0; j--) {
                pre[j] = pre[j + 1] + dp1[j];
                pre[j] %= MOD;
            }

            for (int j = 0; j <= n + 5; j++) {
                dp0[j] = dp1[j];
            }
        }

        long res = 0;
        for (int j = 0; j <= n + 5; j++) {
            res += dp0[j];
            res %= MOD;
        }

        out(res);
    }

    void shuffle(int[] a) {
        int n = a.length;
        for(int i = 0; i < n; i++) {
            int r = i + (int) (Math.random() * (n - i));
            int tmp = a[i];
            a[i] = a[r];
            a[r] = tmp;
        }
    }

    int gcd(int a, int b) {
        while(a != 0 && b != 0) {
            int c = b;
            b = a % b;
            a = c;
        }
        return a + b;
    }
    private void outln(Object o) {
        out.println(o);
    }
    private void out(Object o) {
        out.print(o);
    }
    public CFC() throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        out.close();
    }
    public static void main(String[] args) throws IOException {
        new CFC();
    }

    public long[] nextLongArr(int n) throws IOException{
        long[] res = new long[n];
        for(int i = 0; i < n; i++)
            res[i] = nextLong();
        return res;
    }
    public int[] nextIntArr(int n) throws IOException {
        int[] res = new int[n];
        for(int i = 0; i < n; i++)
            res[i] = nextInt();
        return res;
    }
    public String nextToken() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (Exception e) {
                eof = true;
                return null;
            }
        }
        return st.nextToken();
    }
    public String nextString() {
        try {
            return br.readLine();
        } catch (IOException e) {
            eof = true;
            return null;
        }
    }
    public int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C {

	static ArrayList<Integer> statements;
	static final int MOD = (int) 1e9 + 7;

	static int[][] memo;

	static int solve(int i, int c) {
		if(i == statements.size())
			return 1;
		if(memo[i][c] != -1)
			return memo[i][c];

		long ans = solve(i + 1, c + statements.get(i));
		if(c > 0)
			ans += solve(i, c - 1);
		return memo[i][c] = (int) (ans % MOD);

	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt();
		statements = new ArrayList<>();

		char[] c = new char[n];
		for (int i = 0; i < n; i++) {
			c[i] = sc.next().charAt(0);
		}

		if(c[0] == 's')
			statements.add(0);
		else
			statements.add(1);

		for (int i = 1; i < n; i++) {
			if(c[i - 1] == 'f') {
				if(c[i] == 'f')
					statements.set(statements.size() - 1, statements.get(statements.size() - 1) + 1);
			}else {

				if(c[i] == 's')
					statements.add(0);
				else
					statements.add(1);
			}
		}

		memo = new int[statements.size()][n + 1];

		for(int[] a : memo)
			Arrays.fill(a, -1);
		out.println(solve(0, 0));
		out.flush();
		out.close();
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public Scanner(String file) throws FileNotFoundException {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public boolean ready() throws IOException {
			return br.ready();
		}

	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ShekharN
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        private final int MOD = (int) (1e9 + 7);

        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            String[] arr = new String[n];
            for (int i = 0; i < n; i++) {
                arr[i] = in.nextString();
            }
            int[] dp = new int[n];
            Arrays.parallelSetAll(dp, i -> 0);
            dp[0] = 1;
            int cnt = 0;
            for (int i = 0; i < n; i++) {
                if (arr[i].equals("f")) {
                    cnt++;
                    continue;
                }
                calc(dp, n, cnt);
                cnt = 0;
            }
            int sum = 0;
            for (int i = 0; i < n; i++) {
                sum += dp[i];
                sum %= MOD;
            }
            out.println(sum);
        }

        private void calc(int[] dp, int n, int cnt) {
            for (int i = n - 1; i >= 0; i--) {
                if (i != n - 1) dp[i] += dp[i + 1];
                dp[i] %= MOD;
            }
            int[] tmp = new int[n];
            for (int i = 0; i < n; i++) {
                tmp[(i + cnt) % n] = dp[i];
            }
            Arrays.parallelSetAll(dp, i -> tmp[i]);
        }

    }

    static class FastScanner {
        private BufferedReader br;
        private StringTokenizer st;

        public FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        public FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        public String nextString() {
            while (st == null || !st.hasMoreTokens()) {
                String s = null;
                try {
                    s = br.readLine();
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (s == null)
                    return null;
                st = new StringTokenizer(s);
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ankur
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        String[] str;
        long mod = (long) 1e9 + 7;
        long[][] dp;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            str = new String[n];
            dp = new long[n + 2][n + 2];
            for (int i = 0; i < dp.length; i++) {
                Arrays.fill(dp[i], -1);
            }
            for (int i = 0; i < n; i++) {
                str[i] = in.readString();
            }
            if (str[0].charAt(0) == 'f') {
                out.print(solve(1, 1));
            } else {
                out.print(solve(1, 0));
            }
        }

        long solve(int n, int horiz) {
            if (horiz < 0)
                return 0;
            if (n >= str.length - 1) {
                return 1;
            }
            if (dp[n][horiz] != -1) {
                return dp[n][horiz];
            }
            if (str[n].charAt(0) == 'f') {
                return dp[n][horiz] = solve(n + 1, horiz + 1);
            } else {
                long ans1 = solve(n, horiz - 1);
                //System.out.println(ans1+" "+n+" egsvd"+horiz);
                ans1 += solve(n + 1, horiz);
                //System.out.println(ans1+" "+n+" "+horiz);
                ans1 = ans1 % mod;
                return dp[n][horiz] = ans1;
            }
        }

    }

    static class InputReader {
        private final InputStream stream;
        private final byte[] buf = new byte[8192];
        private int curChar;
        private int snumChars;

        public InputReader(InputStream st) {
            this.stream = st;
        }

        public int read() {
            //*-*------clare------

            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public String readString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author ZYCSwing
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        private static final int MOD = (int) 1e9 + 7;
        private static final int N = 5000;

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] dp = new int[N];
            Arrays.fill(dp, 0);
            dp[0] = 1;
            String pre = null, ch;
            for (int i = 0; i < n; ++i) {
                ch = in.next();
                if (i > 0) {
                    if (pre.equals("s")) {
                        int j = N - 1;
                        while (dp[j] == 0) {
                            --j;
                        }
                        long sum = 0;
                        for (; j >= 0; --j) {
                            sum += dp[j];
                            sum %= MOD;
                            dp[j] = (int) sum;
                        }
                    } else {
                        for (int k = N - 1; k > 0; --k) {
                            dp[k] = dp[k - 1];
                        }
                        dp[0] = 0;
                    }
                }
                pre = ch;
            }

            long sum = 0;
            for (int i = 0; i < N; ++i) {
                sum += dp[i];
                sum %= MOD;
            }
            out.println(sum);
        }

    }
}


import java.util.*;
import java.io.*;

public class p3sol{

	static char[] c;
	static int[][] dp;
	static int mod = (int)1e9 + 7;

	public static void main(String[] args) throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());
		c = new char[n];

		for(int i = 0; i < n; i++)
			c[i] = br.readLine().charAt(0);

		dp = new int[n + 1][n + 1];

		dp[0][0] = 1;

		for(int i = 0; i < n - 1; i++){
			if(c[i] == 's'){
				int prev = 0;
				for(int j = i; j >= 0; j--){
					prev += dp[i][j];
					prev %= mod;
					dp[i + 1][j] += prev;
					dp[i + 1][j] %= mod;
				}
			}
			else{
				for(int j = 1; j <= n; j++){
					dp[i + 1][j] += dp[i][j - 1];
					dp[i + 1][j] %= mod;
				}
			}
		}

		int ans = 0;
		for(int i = 0; i < n; i++){
			ans += dp[n - 1][i];
			ans %= mod;
		}

		// print(dp);

		System.out.println(ans);

		br.close();
	}

	public static void print(int[][] a){
		for(int i = 0; i < a.length; i++){
			for(int j = 0; j < a[0].length; j++)
				System.out.print(a[i][j] + " ");
			System.out.println("");
		}
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        int mod = 1000000007;

        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.readInt();
            int[][] dp = new int[n + 1][5002];
            char[] a = new char[n];
            for (int i = 0; i < n; i++) a[i] = in.readCharacter();

            for (int i = 0; i < dp[n].length; i++) dp[n][i] = 1;

            for (int i = n - 1; i >= 0; i--) {
                for (int j = 0; j < n; j++) {
                    if (a[i] == 's') {
                        if (j > 0) dp[i][j] = dp[i][j - 1];
                        dp[i][j] = (int) ((dp[i][j] + (long) dp[i + 1][j]) % mod);
                    } else {
                        if (j > 0) dp[i][j] = dp[i][j - 1];
                        dp[i][j] = (int) ((dp[i][j] + (long) dp[i + 1][j + 1] - (long) dp[i + 1][j] + mod) % mod);
                    }
                }
            }
            out.println(dp[0][0]);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private InputReader.SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int readInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public char readCharacter() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            return (char) c;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}


import java.util.*;

public class GFG {
    static int count=0;

	public static void main (String[] args) {
		Scanner ob=new Scanner(System.in);
		int n;
		long MOD=(long)(1e9+7);
		int f=0,s=0;
		n=ob.nextInt();
		long dp[][]=new long[n+2][n+2];
		dp[0][1]=1;
		char ch='s';
		char p;
		for(int i=1;i<=n;i++)
		{
		    p=ch;
		    ch=ob.next().charAt(0);
		    if(p=='f')
		    {
		        for(int j=1;j<=n;j++)
		        dp[i][j+1]=dp[i-1][j];
		    }
		    else
		    {
		        for(int j=n;j>0;j--)
		        {
		            dp[i][j]=(dp[i][j+1]+dp[i-1][j])%MOD;
		        }
		    }
		}

		long ans=0;

		for(int i=1;i<=n;i++)
		{
		    ans=(ans+dp[n][i])%MOD;
		}
		System.out.println(ans);
	}
}


import java.awt.*;
import java.io.*;
import java.math.*;
import java.util.*;

public class TaskC {

	public static void main(String[] args) {
		new TaskC().run();
	}

	void solve(){
		int n = in.nextInt();
		String s[] = new String[n];
		for(int i = 0; i < n; i++) s[i] = in.next();
		if(s[n-1].compareTo("f") == 0){
			out.println(0);
			return;
		}
		int dp[] = new int[n+2];
		int mod = 1000*1000*1000+7;
		dp[0] = 1;
		for(int i = n-1; i >= 0; i--){
			if(s[i].compareTo("s") == 0){
				int ss = 0;
				for(int j = 0; j <= n; j++){
					ss += dp[j];
					if(ss>=mod) ss -= mod;
					dp[j] = ss;
				}
			}else{
				for(int j = 0; j < n;j++){
					dp[j] = dp[j+1];
				}
				dp[n] = 0;
			}
		}
		out.println(dp[0]);
	}

	FastScanner in;
	PrintWriter out;
	void run() {
		in = new FastScanner(System.in);
		out = new PrintWriter(System.out);
		int tests = 1;//in.nextInt();
		while(tests > 0){
			solve();
			tests--;
		}
		out.close();
	}

	class Pair implements Comparable<Pair>{
		Integer x, y;
		public Pair(int x, int y){
			this.x = x;
			this.y = y;
		}
		@Override
		public int compareTo(Pair o) {
			if(x.compareTo(o.x) == 0) return y.compareTo(o.y);
			return x.compareTo(o.x);
		}

	}

	class FastScanner {
		StringTokenizer st;
		BufferedReader bf;

		public FastScanner(InputStream is) {
			bf = new BufferedReader(new InputStreamReader(is));
		}

		public FastScanner(File f){
			try{
				bf = new BufferedReader(new FileReader(f));
			}
			catch(IOException ex){
				ex.printStackTrace();
			}
		}
		String next(){
			while(st == null || !st.hasMoreTokens()){
				try{
					st = new StringTokenizer(bf.readLine());
				}
				catch(Exception ex){
					ex.printStackTrace();
				}
			}
			return st.nextToken();
		}
		int nextInt(){
			return Integer.parseInt(next());
		}
		long nextLong(){
			return Long.parseLong(next());
		}
		double nextDouble(){
			return Double.parseDouble(next());
		}
		int[] readArray(int n){
			int[] a = new int[n];
			for(int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}
	}

}


import java.io.*;
import java.util.*;
import java.io.IOException;
import java.io.InputStream;

public class Main {
    public static void main(String[] args) {

        File file = new File("in.txt");
        File fileOut = new File("out.txt");
        InputStream inputStream = null;
        OutputStream outputStream = null;
        // try {inputStream= new FileInputStream(file);} catch (FileNotFoundException ex){return;};
//        try {outputStream= new FileOutputStream(fileOut);} catch (FileNotFoundException ex){return;};
        inputStream = System.in;
        outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }

}

class Task {

    private final int mod = 1000000007;
    public void solve(int testNumber, InputReader in, PrintWriter out) {
        Integer n = in.nextInt();
        List<Character> comm = new ArrayList<>(n);
        for(int i=0; i<n; i++){
            comm.add(in.next().charAt(0));
        }

        long[][] dp = new long[n][n];
        dp[0][0] = 1;
        for(int i=1; i<n; i++){
            Character lastComm = comm.get(i-1);
            if(lastComm.equals('f')){
                dp[i][0] = 0;
                for(int j=1; j<n; j++){
                    dp[i][j] = dp[i-1][j-1];
                }
            }
            else{
                Long suffixSum = dp[i-1][n-1];
                for(int j=n-1; j>=0; j--){
                    dp[i][j] = suffixSum;
                    if(j>0) {
                        suffixSum += dp[i - 1][j - 1] % mod;
                    }
                }
            }
        }

        Long finalSum = 0L;
        for(int i=0; i<n; i++){
            finalSum += dp[n-1][i] % mod;
        }
        out.println(finalSum % mod);

    }

}

class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine(){
        try {
            return reader.readLine();
        } catch (IOException e){
            throw new RuntimeException(e);
        }
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }
    public long nextLong() { return Long.parseLong(next()); }

}

class Pair<F, S> {
    public final F first;
    public final S second;

    public Pair(F first, S second) {
        this.first = first;
        this.second = second;
    }

    @Override
    public boolean equals(Object o) {
        if (!(o instanceof Pair)) {
            return false;
        }
        Pair<?, ?> p = (Pair<?, ?>) o;
        return Objects.equals(p.first, first) && Objects.equals(p.second, second);
    }

    @Override
    public int hashCode() {
        return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode());
    }

    @Override
    public String toString() {
        return "(" + first + ", " + second + ')';
    }
}

class IntPair extends Pair<Integer, Integer>{
    public IntPair(Integer first, Integer second){
        super(first, second);
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        TaskC.InputReader in = new TaskC.InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.Solve(in, out);
        out.close();
    }

    static class TaskC {

        private long mod = 1_000_000_007;
        private int n;
        private boolean[] s;

        public void Solve(InputReader in, PrintWriter out) {
            n = in.NextInt();
            s = new boolean[n];
            for (int i = 0; i < n; i++) {
                String ss = in.Next();
                s[i] = ss.charAt(0) == 'f';
            }
            if (s[n - 1]) {
                out.println(0);
                return;
            }
            long[] dpSum = new long[n + 1], lastDpSum = new long[n + 1];
            for (int i = 0; i <= n; i++) {
                lastDpSum[i] = i + 1;
            }
            for (int i = n - 2; i >= 0; i--) {
                for (int j = 0; j <= i; j++) {
                    if (!s[i]) {
                        dpSum[j] = lastDpSum[j];
                    } else {
                        dpSum[j] = lastDpSum[j + 1] - lastDpSum[j];
                    }
                    if (j != 0) {
                        dpSum[j] += dpSum[j - 1];
                    }
                    dpSum[j] %= mod;
                    while (dpSum[j] < 0) dpSum[j] += mod;

                }
                long[] temp = dpSum;
                dpSum = lastDpSum;
                lastDpSum = temp;
            }
            out.println(lastDpSum[0]);
        }

        public static int GetMax(int[] ar) {
            int max = Integer.MIN_VALUE;
            for (int a : ar) {
                max = Math.max(max, a);
            }
            return max;
        }

        public static int GetMin(int[] ar) {
            int min = Integer.MAX_VALUE;
            for (int a : ar) {
                min = Math.min(min, a);
            }
            return min;
        }

        public static long GetSum(int[] ar) {
            long s = 0;
            for (int a : ar) s += a;
            return s;
        }

        public static int[] GetCount(int[] ar) {
            return GetCount(ar, GetMax(ar));
        }

        public static int[] GetCount(int[] ar, int maxValue) {
            int[] dp = new int[maxValue + 1];
            for (int a : ar) {
                dp[a]++;
            }
            return dp;
        }

        static class InputReader {
            public BufferedReader reader;
            public StringTokenizer tokenizer;

            public InputReader(InputStream stream) {
                reader = new BufferedReader(new InputStreamReader(stream), 32768);
                tokenizer = null;
            }

            public String Next() {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    try {
                        tokenizer = new StringTokenizer(reader.readLine(), " \t\n\r\f,");
                    } catch (IOException e) {
                        throw new RuntimeException(e);
                    }
                }
                return tokenizer.nextToken();
            }

            public int NextInt() {
                return Integer.parseInt(Next());
            }

            public long NextLong() {
                return Long.parseLong(Next());
            }

            public double NextDouble() {
                return Double.parseDouble(Next());
            }

            public int[] NextIntArray(int n) {
                return NextIntArray(n, 0);
            }

            public int[] NextIntArray(int n, int offset) {
                int[] a = new int[n];
                for (int i = 0; i < n; i++) {
                    a[i] = NextInt() - offset;
                }
                return a;
            }

            public int[][] NextIntMatrix(int n, int m) {
                return NextIntMatrix(n, m, 0);
            }

            public int[][] NextIntMatrix(int n, int m, int offset) {
                int[][] a = new int[n][m];
                for (int i = 0; i < n; i++) {
                    for (int j = 0; j < m; j++) {
                        a[i][j] = NextInt() - offset;
                    }
                }
                return a;
            }
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Wolfgang Beyer
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long MOD = 1000000007;

            long[] current = new long[n + 3];
            //long[] sum = new long[n + 3];
            current[0] = 1;

            for (int i = 0; i < n - 1; i++) {

                String s = in.next();
                if (s.equals("f")) {
                    for (int j = i + 1; j > 0; j--) {
                        current[j] = current[j - 1];
                        current[j] %= MOD;
                    }
                    current[0] = 0;
                } else {
                    for (int j = i + 1; j >= 0; j--) {
                        //sum[j] = sum[j + 1] + current[j];
                        current[j] = current[j + 1] + current[j];
                        current[j] %= MOD;
                    }
                    //for (int j = 0; j <= i + 1; j++) {
                    //  current[j] =
                    //}
                }
            }
            long result = 0;
            for (int i = 0; i <= n; i++) {
                result += current[i];
                result %= MOD;
            }
            out.println(result);
        }

    }

    static class InputReader {
        private static BufferedReader in;
        private static StringTokenizer tok;

        public InputReader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public String next() {
            try {
                while (tok == null || !tok.hasMoreTokens()) {
                    tok = new StringTokenizer(in.readLine());
                    //tok = new StringTokenizer(in.readLine(), ", \t\n\r\f"); //adds commas as delimeter
                }
            } catch (IOException ex) {
                System.err.println("An IOException was caught :" + ex.getMessage());
            }
            return tok.nextToken();
        }

    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

/*

 */
public class C455 {
	static int N;
	static final int mod = 1_000_000_007;
	static int[][] memo;
	static int[] list;
	public static void main(String[] args) {
		FS scan = new FS(System.in);

		N = scan.nextInt();
		list = new int[N];
		for(int i=0;i<N;i++) {
			list[i] = scan.next().equals("s")?0:1;
		}
		if(list[N-1] == 1) {
			System.out.println(0);
			return;
		}
		memo = new int[N+1][N+2];
		Arrays.fill(memo[N], 1);
		int[] sum = new int[N+2];

		for(int i=N-1;i>=0;i--) {
			sum[0] = memo[i+1][0];
			for(int j=1;j<sum.length;j++) {
				sum[j] = sum[j-1] + memo[i+1][j];
				sum[j] %= mod;
			}
			for(int j=0;j<=N;j++) {
				if (list[i]==1 && (i==0 || list[i-1]==1))
					memo[i][j] = memo[i+1][j+1];
				else if(i==0 || list[i-1] == 1)
					memo[i][j] = memo[i+1][j];
				else if (list[i]==1){
//					for(int k=0;k<=j;k++) {
//						memo[i][j] += memo[i+1][k+1];
//					}
					memo[i][j] = sum[j+1] - sum[0] + mod;
					memo[i][j] %= mod;

				}
				else if (list[i]==0) {
					memo[i][j] = sum[j];
				}
			}
		}

//		for(int i=0;i<=N;i++) {
//			for(int j=0;j<=N;j++) {
//				System.out.print(memo[i][j]+" ");
//			}
//			System.out.println();
//		}
//		System.out.println();
		System.out.println(memo[0][0]);
	}

	private static class FS {
		BufferedReader br;
		StringTokenizer st;
		public FS(InputStream in) {
			br = new BufferedReader(new InputStreamReader(in));
		}
		String next(){
			while(st==null||!st.hasMoreElements()){
				try{st = new StringTokenizer(br.readLine());}
				catch(IOException e){e.printStackTrace();}
			}
			return st.nextToken();
		}
		int nextInt() {return Integer.parseInt(next());}
		long nextLong() {return Long.parseLong(next());}
		double nextDouble() { return Double.parseDouble(next());}
	}
}


import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static final int MAX = 5000 + 10,mod = 1000000007;
    private static char [] S;
    private static int n;
    private static Integer [] [] dp = new Integer[MAX][MAX];

    private static int solve(int pos,int open){
        if(pos == n) return (open == 0) ? 1 : 0;
        if (dp[pos][open] != null) return dp[pos][open];
        int res = 0;
        if (S[pos] == 's') {
            res = solve(pos + 1,open);
            if (open > 0) res += solve(pos,open - 1);
            if (res >= mod) res -= mod;
        }
        else {
            res = solve(pos+1,open + 1);
        }
        return dp[pos][open] = res;
    }

    public static void main(String[] args) throws Exception{
        IO io = new IO(null,null);
        n = io.getNextInt();
        S = new char[n];
        for (int i = 0;i < n;i++) S[i] = io.getNext().charAt(0);
        io.println(solve(0,0));
        io.close();
    }
}

class IO{
    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter writer;
    private String inputFile,outputFile;

    public boolean hasMore() throws IOException{
        if(st != null && st.hasMoreTokens()) return true;
        if(br != null && br.ready()) return true;
        return false;
    }
    public String getNext() throws FileNotFoundException, IOException{
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public String getNextLine() throws FileNotFoundException, IOException{
        return br.readLine().trim();
    }

    public int getNextInt() throws FileNotFoundException, IOException{
        return Integer.parseInt(getNext());
    }
    public long getNextLong() throws FileNotFoundException, IOException{
        return Long.parseLong(getNext());
    }

    public void print(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f" ,x);
    }
    public void println(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f\n" ,x);
    }
    public void print(Object o) throws  IOException{
        writer.print(o.toString());
    }

    public void println(Object o) throws  IOException{
        writer.println(o.toString());
    }
    public IO(String x,String y) throws FileNotFoundException, IOException{
        inputFile = x;
        outputFile = y;
        if(x != null) br = new BufferedReader(new FileReader(inputFile));
        else br = new BufferedReader(new InputStreamReader(System.in));
        if(y != null) writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        else writer = new PrintWriter(new OutputStreamWriter(System.out));
    }

    protected void close() throws IOException{
        br.close();
        writer.close();
    }
}


import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * Created by Jarek on 2017-12-30.
 */
public class PhytonIndenter {

    private static Scanner scanner = new Scanner(System.in);

    private static int lineCount;
    private static String[] commands;

    public static void main(String args[]) {
        lineCount = scanner.nextInt();
        scanner.nextLine();
        commands = new String[lineCount];

        for (int i = 0; i < lineCount; i++) {
            commands[i] = scanner.nextLine();
        }

        resolveWithDP();
    }

    private static void resolveWithDP() {
        long dp[][] = new long[lineCount][5002];
        long mod = 1000000007;
        dp[0][0] = 1;
        for (int i = 1; i < lineCount; i++) {
            if ("f".equalsIgnoreCase(commands[i - 1])) {
                dp[i][0] = 0;
                for (int j = 1; j <= i; j++) {
                    dp[i][j] = dp[i - 1][j - 1];
                }
            } else {
                long sum = 0;
                for (int j = i - 1; j >= 0; j--) {
                    sum += dp[i - 1][j] % mod;
                    dp[i][j] = sum;
                }
            }
        }

        long result = 0;
        for (int i = 0; i < lineCount; i++) {
            result += dp[lineCount-1][i]%mod;
            result %= mod;
        }
        System.out.println(result%mod);
    }

}


import java.util.*;
import java.io.*;

/* spar5h */

public class codeforces implements Runnable {

	final static long mod = (long)1e9 + 7;

	public void run() {

		InputReader s = new InputReader(System.in);
		PrintWriter w = new PrintWriter(System.out);

		int n = s.nextInt();

		char[] c = new char[n];

		for(int i = 0; i < n; i++)
			c[i] = s.next().charAt(0);

		//index + depth/indentation
		long[][] dp = new long[n][n];
		dp[0][0] = 1;

		for(int i = 0; i < n - 1; i++) {

			//c[i] = f implies that indentation will always be increased by one in i + 1
			if(c[i] == 'f') {

				for(int j = 1; j < n; j++)
					dp[i + 1][j] = dp[i][j - 1];
			}

			//c[i] = s implies that value of i + 1 can include any previous value of equal or higher indentation
			else {

				dp[i + 1][n - 1] = dp[i][n - 1];

				for(int j = n - 2; j >= 0; j--)
					dp[i + 1][j] = (dp[i + 1][j + 1] + dp[i][j]) % mod;
			}
		}

		long res = 0;

		for(int i = 0; i < n; i++)
			res = (res + dp[n - 1][i]) % mod;

		w.println(res);

		w.close();
	}

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}

	public static void main(String args[]) throws Exception
	{
		new Thread(null, new codeforces(),"codeforces",1<<26).start();
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Pradyumn
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        static final long MODULO = (long) (1e9 + 7);

        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            long[][] dp = new long[n + 100][n + 100];
            dp[0][0] = 1;
            for (int i = 0; i < n; ++i) {
                char current = in.nextCharacter();
                if (current == 'f') {
                    for (int j = 0; j < n; ++j) {
                        dp[i + 1][j + 1] += dp[i][j];
                        dp[i + 1][j + 1] %= MODULO;
                    }
                } else {
                    long runningSum = 0;
                    for (int j = n; j >= 0; --j) {
                        runningSum += dp[i][j];
                        runningSum %= MODULO;

                        dp[i + 1][j] += runningSum;
                        dp[i + 1][j] %= MODULO;
                    }
                }
            }
            out.println(dp[n][0]);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar;
        private int pnumChars;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        private int pread() {
            if (pnumChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= pnumChars) {
                curChar = 0;
                try {
                    pnumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (pnumChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = pread();
            }
            int res = 0;
            do {
                if (c == ',') {
                    c = pread();
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = pread();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public char nextCharacter() {
            int c = pread();
            while (isSpaceChar(c))
                c = pread();
            return (char) c;
        }

    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.List;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.util.Collections;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputStream;

public class C909 {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int ar[] = new int[n+1];
            int count = 1;
            ar[0] = 1;
            for(int i=0;i<n;i++){
                char c = in.next().charAt(0);
                if(c == 'f')
                    count++;
                else{
                    for(int j=1;j<count;j++){
                        ar[j] = (ar[j] + ar[j-1])% (int)(1e9+7);
                    }
                }
            }
            out.println(ar[count-1]);
        }
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            String str = "";
            try
            {
                str = reader.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


import java.io.*;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.*;

public class Main {

    public static void main(String[] args) {

        solve(System.in,System.out);

    }

    static void solve(InputStream inStream, PrintStream printStream) {
        Scanner in = new Scanner(inStream);
        int n = in.nextInt();
        long[] sums = new long[n];
        for (int i = 1; i < n; i++) {
            sums[i]=0;
        }
        sums[0]=1;

        long mod = 1000000007;

        for (int i = 0; i < n; i++) {
            if (in.next().equals("f") ) {
                for (int j = n-1; j > 0 ; j--) {
                    sums[j]=sums[j-1];
                }
                sums[0]=0;
            } else {
                for (int j = n-2; j >= 0 ; j--) {
                    sums[j] += sums[j+1];
                    if (sums[j]>=mod) {
                        sums[j]-=mod;
                    }
                }
            }
        }

//        long finalSum = 0;
//        for (int i = 0; i < n; i++) {
//            finalSum+=sums[i];
//        }

        printStream.println(sums[0]);

    }

}


import java.util.*;
import java.io.*;
public class C {

  static InputReader in = new InputReader(System.in);
  static PrintWriter out = new PrintWriter(System.out);

  public static void main(String[] args) {
    int n = in.nextInt();
    int[] sol = new int[n];
    sol[0] = 1;
    int mod = 1000000007;
    int maxind = 0;
    boolean f = true;
    for (int i = 0; i < n; i++) {
      if (!f) {
        //int accum = sol[0];
        for (int j = 1; j <= maxind; j++) {
          sol[j] += sol[j-1];
          sol[j] %= mod;
        }
        //out.println(Arrays.toString(sol));
      }
      if (in.next().equals("f")) {
        maxind++;
        f = true;
      }
      else {
        f = false;
      }
    }
    int ans = 0;
    for (int i = 0; i <= maxind; i++) {
      ans += sol[i];
      ans %= mod;
    }
    out.println(ans);
    finish();
  }

  public static void finish() {
    out.close();
    in.close();
    System.exit(0);
  }

  static class InputReader implements Iterator<String>, Closeable {
    // Fast input reader. Based on Kattio.java from open.kattis.com
    // but has method names to match Scanner

    private BufferedReader r;
    private String line;
    private StringTokenizer st;
    private String token;

    public InputReader(InputStream i) {
      r = new BufferedReader(new InputStreamReader(i));
    }

    public boolean hasNext() {
      return peekToken() != null;
    }

    public int nextInt() {
      return Integer.parseInt(nextToken());
    }

    public double nextDouble() {
      return Double.parseDouble(nextToken());
    }

    public long nextLong() {
      return Long.parseLong(nextToken());
    }

    public String next() {
      return nextToken();
    }

    public String nextLine() {
      try {
        line = r.readLine();
      } catch (IOException e) {
        line = null;
      }
      token = null;
      st = null;
      return line;
    }

    public void close() {
      try {
        r.close();
      } catch (IOException e) {
      }
    }

    private String peekToken() {
      if (token == null)
        try {
          while (st == null || !st.hasMoreTokens()) {
            line = r.readLine();
            if (line == null)
              return null;
            st = new StringTokenizer(line);
          }
          token = st.nextToken();
        } catch (IOException e) {
        }
      return token;
    }

    private String nextToken() {
      String ans = peekToken();
      token = null;
      return ans;
    }

  }

}


import java.util.Scanner;

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
/**
 *
 * @author EndUser
 */
public class R455D2PC {

    public static void main(String[] args) {
        final int MAX = 5000;
        final int MODULO = 1000000007;

        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        in.nextLine();

        int pre = 0;
        int size = 0;

        int[] block = new int[MAX];
        for (int i = 0; i < n; i++) {
            String command = in.nextLine();
            if (command.startsWith("s")) {
                block[size++] = pre;
                pre = 0;
            } else {
                pre++;
            }
        }

        if (pre != 0) {
            System.out.println(0);
            return;
        }

        int[][] result = new int[2][MAX + 1];
        int currentMax = 0;
        int preIndex = 0;
        result[preIndex][0] = 1;
        for (int i = 1; i < size; i++) {
            int currentIndex = preIndex ^ 1;
            int j = block[i - 1];
            for (int k = currentMax; k >= 0; k--) {
                result[currentIndex][k + j] = (result[currentIndex][k + j + 1] + result[preIndex][k]) % MODULO;
            }
            for (int k = j - 1; k >= 0; k--) {
                result[currentIndex][k] = result[currentIndex][j];

            }
            currentMax += j;
            preIndex = currentIndex;
//            for (int k = 0; k <= currentMax; k++) {
//                System.out.print(result[preIndex][k] + " ");
//
//            }
//            System.out.println("");
        }

        int sum = 0;
        for (int i = 0; i <= currentMax; i++) {
            sum = (sum + result[preIndex][i]) % MODULO;
        }

        System.out.println(sum);
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C {
	static int [][] memo;
	static int n;
	static char [] c;
	static int mod = (int)1e9+7;
	static int dp(int ind, int loops){
		if(ind == n)
			return loops == 0?1:0;
		if(memo[ind][loops] != -1)
			return memo[ind][loops];
		long ans = 0;
		if(c[ind] == 's'){
			ans = (ans + dp(ind+1, loops))%mod;
			if(loops > 0)
				ans = (ans + dp(ind, loops-1))%mod;
		}
		else{
			ans = (ans + dp(ind+1, loops+1))%mod;
		}
		return memo[ind][loops] = (int) ans;
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		n = sc.nextInt();
		memo = new int[n+1][n+1];
		for(int [] i:memo)
			Arrays.fill(i, -1);
		c = new char[n];
		for (int i = 0; i < c.length; i++) {
			c[i] = sc.next().charAt(0);
		}
		out.println(dp(0,0));
		out.flush();
		out.close();
	}

	static class Scanner {
		BufferedReader bf;
		StringTokenizer st;

		public Scanner(InputStream i) {
			bf = new BufferedReader(new InputStreamReader(i));

		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(bf.readLine());
			return st.nextToken();
		}

		public int nextInt() throws NumberFormatException, IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			String x = next();
			StringBuilder sb = new StringBuilder("0");
			double res = 0, f = 1;
			boolean dec = false, neg = false;
			int start = 0;
			if (x.charAt(0) == '-') {
				neg = true;
				start++;
			}
			for (int i = start; i < x.length(); i++)
				if (x.charAt(i) == '.') {
					res = Long.parseLong(sb.toString());
					sb = new StringBuilder("0");
					dec = true;
				} else {
					sb.append(x.charAt(i));
					if (dec)
						f *= 10;
				}
			res += Long.parseLong(sb.toString()) / f;
			return res * (neg ? -1 : 1);
		}

		public long nextLong() throws NumberFormatException, IOException {
			return Long.parseLong(next());
		}
	}
}


import java.io.*;
import java.util.*;
import java.math.*;
import java.util.concurrent.*;

public final class py_indent
{
    static BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
	static FastScanner sc=new FastScanner(br);
    static PrintWriter out=new PrintWriter(System.out);
	static Random rnd=new Random();
	static int maxn=(int)(5e3+5);
	static long mod=(long)(1e9+7);

	static int add(long a,long b)
	{
		long ret=(a+b);

		if(ret>=mod)
		{
			ret%=mod;
		}

		return (int)ret;
	}

    public static void main(String args[]) throws Exception
    {
		int n=sc.nextInt();char[] a=new char[n+1];a[0]='s';

		for(int i=1;i<=n;i++)
		{
			a[i]=sc.next().charAt(0);
		}

		int[][] dp=new int[n+1][maxn],sum=new int[n+1][maxn];dp[0][0]=1;

		sum[0][0]=1;

		for(int i=1;i<maxn;i++)
		{
			sum[0][i]=add(sum[0][i],sum[0][i-1]);
		}

		for(int i=1;i<=n;i++)
		{
			if(a[i]=='f')
			{
				continue;
			}

			int curr=0,idx=0;

			for(int j=i-1;j>=0;j--)
			{
				if(a[j]=='s')
				{
					idx=j;break;
				}

				else
				{
					curr++;
				}
			}

			for(int j=0;j<maxn;j++)
			{
				int up=Math.max(0,j-curr);

				long now=(sum[idx][maxn-1]-(up==0?0:sum[idx][up-1]));

				now=add(now,mod);

				dp[i][j]=add(dp[i][j],now);
			}

			sum[i][0]=dp[i][0];

			for(int j=1;j<maxn;j++)
			{
				sum[i][j]=add(dp[i][j],sum[i][j-1]);
			}
		}

		//out.println(dp[2][0]+" "+dp[2][1]+" "+dp[2][2]);

		out.println(dp[n][0]);out.close();
    }
}
class FastScanner
{
    BufferedReader in;
    StringTokenizer st;

    public FastScanner(BufferedReader in) {
        this.in = in;
    }

    public String nextToken() throws Exception {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(in.readLine());
        }
        return st.nextToken();
    }

	public String next() throws Exception {
		return nextToken().toString();
	}

    public int nextInt() throws Exception {
        return Integer.parseInt(nextToken());
    }

    public long nextLong() throws Exception {
        return Long.parseLong(nextToken());
    }

    public double nextDouble() throws Exception {
        return Double.parseDouble(nextToken());
    }
}


//package round455;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;

public class C {
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	void solve()
	{
		int n = ni();
		int mod = 1000000007;
		long[] dp = new long[5005];
		dp[0] = 1;
		for(int i = 0;i < n;i++){
			char c = nc();
			if(c == 's'){
				if(i < n-1){
					for(int j = 5003;j >= 0;j--){
						dp[j] += dp[j+1];
						if(dp[j] >= mod)dp[j] -= mod;
					}
				}
			}else{
				for(int j = 5003;j >= 0;j--){
					dp[j+1] = dp[j];
				}
				dp[0] = 0;
			}
		}
		long ans = 0;
		for(int i = 0;i < 5005;i++)ans += dp[i];
		out.println(ans % mod);
	}

	void run() throws Exception
	{
		is = oj ? System.in : new ByteArrayInputStream(INPUT.getBytes());
		out = new PrintWriter(System.out);

		long s = System.currentTimeMillis();
		solve();
		out.flush();
		tr(System.currentTimeMillis()-s+"ms");
	}

	public static void main(String[] args) throws Exception { new C().run(); }

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte()
	{
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }

	private String ns()
	{
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n)
	{
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m)
	{
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}

	private int[] na(int n)
	{
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}

	private int ni()
	{
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl()
	{
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
	private void tr(Object... o) { if(!oj)System.out.println(Arrays.deepToString(o)); }
}


import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C {

	public static void main(String[] args){
		try(Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();

			String[] ins = new String[N];
			for(int i = 0; i < N; i++){
				ins[i] = sc.next();
			}

			final long MOD = 1000000007;
			long[] DP = new long[N];
			long[] nextDP = new long[N];

			DP[0] = 1;

			for(int i = 1; i < N; i++){
				Arrays.fill(nextDP, 0);
				if("f".equals(ins[i - 1])){
					for(int j = 0; j < N - 1; j++){
						nextDP[j + 1] += DP[j];
						nextDP[j + 1] %= MOD;
					}
				}else{
					for(int j = N - 1; j >= 0; j--){
						nextDP[j] += DP[j];
						nextDP[j] %= MOD;

						if(j < N - 1){
							nextDP[j] += nextDP[j + 1];
							nextDP[j] %= MOD;
						}
					}
				}

				{
					long[] tmp = DP;
					DP = nextDP;
					nextDP = tmp;
				}
			}

			long answer = 0;
			for(int i = 0; i < N; i++){
				answer += DP[i];
				answer %= MOD;
			}

			System.out.println(answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() {
			try {
				while (!hasNext()) {
					tok = new StringTokenizer(br.readLine());
				}
			} catch (IOException e) { /* ignore */
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() {
			getLine();
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

		public long nextLong() {
			return Long.parseLong(next());
		}

		public void close() {
			try {
				br.close();
			} catch (IOException e) { /* ignore */
			}
		}
	}
}


import java.util.* ;
import java.io.* ;

public class PythonIndentation
{
	public static void main(String args[])
	{
		Scanner in = new Scanner(System.in) ;
		int n = in.nextInt() ;
		boolean[] lst = new boolean[n] ;
		for(int i=0;i<n;i++)
		{
			lst[i] = (in.next().equals("s"))?false:true ;
		}
		System.out.println(dp(lst)) ;
	}
	static void  arrayPrinter(int[][] dp)
	{
		System.out.println(":::") ;
		for(int i=0;i<dp.length;i++)
		{
			for(int j=0;j<dp[0].length;j++)
			{
				System.out.print(dp[i][j]+" ") ;
			}
			System.out.println() ;
		}
	}
	static int dp(boolean[] lst)
	{//false in lst means an "s" (simple statement), and true a "f"(for loop)
		int[][] dp = new int[2][lst.length] ;
		dp[0][0] = 1 ;
		for(int i=1;i<lst.length;i++)
		{
			// arrayPrinter(dp) ;
			for(int j=0;j<lst.length;j++)
			{
				if(lst[i-1])//(i-1)st statement is a for loop
				{
					if(j==0)
						dp[i%2][j] = 0 ;
					else
						dp[i%2][j] = dp[(i-1)%2][j-1] ;
				}

				else//i-1 st statement is a simple statement
				{
					if(j==0)
					{
						int temp = 0 ;
						for(int k=0;k<lst.length;k++)
							temp = (temp+dp[(i-1)%2][k])%1000000007 ;
						dp[i%2][j] = temp ;
					}
					else
						dp[i%2][j] = (dp[i%2][j-1]-dp[(i-1)%2][j-1])%1000000007 ;
				}
			}
		}
		int ans = 0 ;
		for(int i=0;i<lst.length;i++)
		{
			ans = (ans + dp[(lst.length-1)%2][i])%1000000007 ;
		}
		if(ans<0)
			ans = ans + 1000000007 ;
		// arrayPrinter(dp) ;
		return ans ;
	}
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.io.BufferedReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author phantom11
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        long MOD = (long) 1e9 + 7;
        long[][] dp;
        int[] a;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            int N = in.nextInt();
            a = new int[N];
            dp = new long[N][N];
            int i;
            for (i = 0; i < N; i++) {
                char c = in.nextChar();
                if (c == 'f') {
                    a[i] = 1;
                }
            }

            out.printLine(iterative());
//        for(i=0;i<=N;i++) {
//            Arrays.fill(dp[i], -1);
//        }
//        out.printLine(recur(0, 0));
        }

        public long iterative() {
            int i, j, N = a.length, lastLevel = 0;
            dp[0][0] = 1;
            for (i = 1; i < N; i++) {
                if (a[i - 1] == 1) {
                    lastLevel++;
                    for (j = 1; j <= lastLevel; j++) {
                        dp[i][j] = dp[i - 1][j - 1];
                    }
                } else {
                    dp[i][N - 1] = dp[i - 1][N - 1];
                    for (j = N - 2; j >= 0; j--) {
                        dp[i][j] = (dp[i][j + 1] + dp[i - 1][j]) % MOD;
                    }
                }
            }
            long ans = 0;
            for (i = 0; i < N; i++) {
                ans += dp[N - 1][i];
            }
            return ans % MOD;
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tokenizer = null;

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
        }

        public String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(in.readLine());
                }
                return tokenizer.nextToken();
            } catch (IOException e) {
                return null;
            }
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public char nextChar() {
            return next().charAt(0);
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0)
                    writer.print(' ');
                writer.print(objects[i]);
            }
        }

        public void printLine(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

    }
}


import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		long MOD = 1000000007;
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long[][]dp = new long[n][5010];
		char[] program = new char[n];

		for(int i = 0; i < n; i++){
			program[i] = sc.next().charAt(0);
		}

		dp[0][0] = 1;

		long[] acc = new long[5010];

		acc[0] = 1;

		for(int i = 1 ; i < n; i++){
			for(int j = 0; j< 5010; j++){
				if(program[i-1] == 'f'){
					if(j - 1 >= 0){
						dp[i][j] = dp[i-1][j-1];
					}
				}else{
					dp[i][j] = acc[j];
				}
			}
			acc[5009] = dp[i][5009];
			for(int j = 5008; j >= 0; j--){
				acc[j] = (acc[j + 1] + dp[i][j]) % MOD;
			}
		}
		System.out.println(acc[0]);
	}
}


/*
 * Institute DA-IICT
 */

import java.io.*;
import java.math.*;
import java.util.*;

public class C
{

	InputStream in;
	PrintWriter out;

	void solve()
	{
		int n=ni();
		long dp[]=new long[n+1];

		dp[0]=1;
		for (int i=0;i<n;)
		{
			i++;
			if (nc()=='f')
			{
				//boolean flag=i==1;
				i++;
				int k=1;
				while (nc()!='s')
				{
					i++;k++;
				}
				//long dp1[]=Arrays.copyOf(dp, n+1);
				for (int j=n-1;j>=0;j--)
				{
					dp[j]=add(dp[j],dp[j+1]);
				}

				for (int j=n;j>=k;j--)
				{
					dp[j]=dp[j-k];
				}
				for (int j=0;j<k;j++)
					dp[j]=0;
			}
			else
			{
				for (int j=n-1;j>=0;j--)
				{
					dp[j]=add(dp[j],dp[j+1]);
				}
			}
			//tr(dp);
		}
		long sum=0;
		for (int i=0;i<=n;i++)
			sum=add(sum,dp[i]);
		out.println(sum);
	}

	class LazyPropagation
		{
			long tree[];
			long lazy[];
			long A[];
			public LazyPropagation(int n,long arr[])
			{
				tree=new long[4*n];
				lazy=new long[4*n];
				A=arr;
				buildSum(1,1,n);
			}

			public LazyPropagation(int n)
			{
				tree=new long[4*n];
				lazy=new long[4*n];
			}

			void buildSum(int node,int start,int end)
			{
				if (start==end)
				{
					tree[node]=A[start];
				}
				else
				{
					int mid=(start+end)>>1;
					buildSum(node*2, start, mid);
					buildSum(node*2+1, mid+1, end);
					tree[node]=tree[node*2]+tree[2*node+1];
				}
			}

			void updateRangeSum(int node, int start, int end,int l,int r,long val)
			{
				if (lazy[node]!=0)
				{
					tree[node]=add(tree[node],mul((end-start+1),lazy[node]));
					if (start!=end)
					{
						lazy[2*node]=add(lazy[2*node],lazy[node]);
						lazy[node*2+1]=add(lazy[2*node+1],lazy[node]);
					}
					lazy[node]=0;
				}
				if (start>end||start>r||end<l)
					return;

				if (start>=l&&end<=r)
				{
					tree[node]=add(tree[node],mul((end-start+1),val));
					if (start!=end)
					{
						lazy[2*node]=add(lazy[2*node],val);
						lazy[node*2+1]=add(lazy[2*node+1],val);
					}
					return;
				}
				int mid=(start+end)>>1;
				updateRangeSum(node*2, start, mid, l, r, val);
				updateRangeSum(node*2+1, mid+1, end, l, r, val);
				tree[node]=add(tree[node*2],tree[node*2+1]);

			}

			long queryRangeSum(int node,int start,int end,int l,int r)
			{
				if (start>r||end<l||start>end)
					return 0;
				if (lazy[node]!=0)
				{
					tree[node]=add(tree[node],mul((end-start+1),lazy[node]));
					if (start!=end)
					{
						lazy[2*node]=add(lazy[2*node],lazy[node]);
						lazy[node*2+1]=add(lazy[2*node+1],lazy[node]);
					}
					lazy[node]=0;
				}

				if (start>=l&&end<=r)
					return tree[node];

				int mid=(start+end)>>1;
				return add(queryRangeSum(node*2, start, mid, l, r),queryRangeSum(node*2+1, mid+1, end, l, r));
			}
		}

	long mod=(long)1e9+7;
	long add(long a,long b)
	{
		long x=(a+b);
		while(x>=mod) x-=mod;
		return x;

	}

	long sub(long a,long b)
	{
		long x=(a-b);
		while(x<0) x+=mod;
		return x;

	}

	long mul(long a,long b)
	{
		a%=mod;
		b%=mod;
		long x=(a*b);
		return x%mod;

	}

	void run() throws Exception {
		String INPUT = "C:/Users/ayubs/Desktop/input.txt";
		in = oj ? System.in : new FileInputStream(INPUT);
		out = new PrintWriter(System.out);

			long s = System.currentTimeMillis();
			solve();
			out.flush();
			tr(System.currentTimeMillis() - s + "ms");
	}
	public static void main(String[] args) throws Exception {
		new C().run();
	}

	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = in.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean inSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && inSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}

	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(inSpaceChar(b))) { // when nextLine, (inSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(inSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}

}


import java.io.*;
import java.util.*;

public class A{
	InputStream is;
	PrintWriter out;
	String INPUT = "";

	public void solve(){
		int n=ni();
		char[] arr=new char[n];
		for(int i=0;i<n;i++){
			arr[i]=ns().charAt(0);
		}

		long mod=1000000007;
		long[][] memo=new long[n][n];
		memo[0][0]=1L;
		int k=0;
		for(int i=1; i<n; i++){
			if( (arr[i]=='f' && arr[i-1]=='s') || (arr[i]=='s' && arr[i-1]=='s') ){
				long sum=0;
				for(int j=k; j>=0; j--){
					sum=(sum+(memo[i-1][j]%mod))%mod;
					memo[i][j]=sum;
				}
			}
			else{
				k+=1;
				for(int j=1; j<=k; j++){
					memo[i][j] = memo[i-1][j-1] % mod;
				}
			}
		}
		//print(n, memo);
		long sum=0;
		for(int i=0;i<=k;i++){
			sum=(sum+(memo[n-1][i])%mod)%mod;
		}
		out.println(sum);
	}
	void print(int n, long[][] memo){
		for(int i=0;i<n;i++){
			for(int j=0;j<n;j++){
				out.print(memo[i][j]+" ");
			}
			out.println();
		}
	}

	void run(){
		is = new DataInputStream(System.in);
		out = new PrintWriter(System.out);
		int t=1;while(t-->0)solve();
		out.flush();
	}
	public static void main(String[] args)throws Exception{new A().run();}
	//Fast I/O code is copied from uwi code.
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;
	private int readByte(){
		if(lenbuf == -1)throw new InputMismatchException();
		if(ptrbuf >= lenbuf){
			ptrbuf = 0;
			try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
			if(lenbuf <= 0)return -1;
		}
		return inbuf[ptrbuf++];
	}
	private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
	private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }
	private double nd() { return Double.parseDouble(ns()); }
	private char nc() { return (char)skip(); }
	private String ns(){
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	private char[] ns(int n){
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while(p < n && !(isSpaceChar(b))){
			buf[p++] = (char)b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}
	private char[][] nm(int n, int m){
		char[][] map = new char[n][];
		for(int i = 0;i < n;i++)map[i] = ns(m);
		return map;
	}
	private int[] na(int n){
		int[] a = new int[n];
		for(int i = 0;i < n;i++)a[i] = ni();
		return a;
	}
	private int ni(){
		int num = 0, b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	private long nl(){
		long num = 0;
		int b;
		boolean minus = false;
		while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
		if(b == '-'){
			minus = true;
			b = readByte();
		}

		while(true){
			if(b >= '0' && b <= '9'){
				num = num * 10 + (b - '0');
			}else{
				return minus ? -num : num;
			}
			b = readByte();
		}
	}
	static  int i(long x){return (int)Math.round(x);}
	static class Pair implements Comparable<Pair>{
		long fs,sc;
		Pair(long a,long b){
			fs=a;sc=b;
		}
		public int compareTo(Pair p){
			if(this.fs>p.fs)return 1;
			else if(this.fs<p.fs)return -1;
			else{
				return i(this.sc-p.sc);
			}
			//return i(this.sc-p.sc);
		}
		public String toString(){
			return "("+fs+","+sc+")";
		}
	}

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class C {

	static int N;
	static char[] a;
	static int[][] memo;
	static int[] ind;
	static final int MOD = (int) 1e9 + 7;

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		N = sc.nextInt(); a = new char[N];
		for(int i = 0; i < N; i++) a[i] = sc.nextChar();

		if(N == 1){out.println(1); out.flush(); return;}
		memo = new int[N][N + 5];
		for(int[] a : memo) Arrays.fill(a, -1);

		out.println(dp(0, 1));
		out.flush();
		out.close();
	}

	static int dp(int i, int ind)
	{
		if(i == N - 1) return a[i - 1] == 'f'? 1 : ind;
		if(i == 0) return dp(i + 1, a[i] == 's'? 1 : 2);
		if(memo[i][ind] != -1) return memo[i][ind];
		int ans = 0;
		if(a[i - 1] == 'f')
			ans = dp(i + 1, a[i] == 's'? ind : ind + 1);
		else
		{
			if(ind > 1)
				ans = (ans + dp(i, ind -1)) % MOD;
			ans = (ans + dp(i + 1, a[i] == 's'? ind : ind + 1)) % MOD;
		}
		return memo[i][ind] = ans;
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		Scanner(InputStream system) {br = new BufferedReader(new InputStreamReader(system));}
		Scanner(String file) throws FileNotFoundException {br = new BufferedReader(new FileReader(file));}
		String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		String nextLine()throws IOException{return br.readLine();}
		int nextInt() throws IOException {return Integer.parseInt(next());}
		double nextDouble() throws IOException {return Double.parseDouble(next());}
		char nextChar()throws IOException{return next().charAt(0);}
		Long nextLong()throws IOException{return Long.parseLong(next());}
		boolean ready() throws IOException{return br.ready();}
		void waitForInput(){for(long i = 0; i < 3e9; i++);}
	}
}


import java.util.*;
import java.io.*;
import java.math.*;

public class C{

	static long mod=1000000007;
	static int n;
	static long w[][];
	static void MainMethod()throws Exception{
		n=reader.nextInt();
		w=new long[n+2][n+2];
		for (int i=0;i<=(n+1);i++)
			Arrays.fill(w[i], 0);
		w[1][0]=1;
		String prev,next;
		prev=reader.next();
		long s[]=new long[n+2];
		for (int i=2;i<=n;i++) {
			next=reader.next();
			if (prev.equals("f"))
				for (int lv=0;lv<=n;lv++)
					w[i][lv+1]=w[i-1][lv];
			else
				for (int lv=n;lv>=0;lv--){
					w[i][lv]=(w[i-1][lv]+w[i][lv+1])%mod;
				}
			prev=next;
		}
		long res=0;
		for (int i=0;i<=n;i++)
			res=(res+w[n][i])%mod;
		printer.print(res);
	}
	public static void main(String[] args)throws Exception{
		MainMethod();
		printer.close();
	}
	static void halt(){
		printer.close();
		System.exit(0);
	}
	static PrintWriter printer=new PrintWriter(new OutputStreamWriter(System.out));
	static class reader{
		static BufferedReader bReader=new BufferedReader(new InputStreamReader(System.in));
		static StringTokenizer token=new StringTokenizer("");
		static String readNextLine() throws Exception{
			return bReader.readLine();
		}
		static String next() throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return token.nextToken();
		}
		static int nextInt()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Integer.parseInt(token.nextToken());
		}
		static long nextLong()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Long.parseLong(token.nextToken());
		}
		static double nextDouble()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Double.parseDouble(token.nextToken());
		}
	}
	static class MyMathCompute{
		static long [][] MatrixMultiplyMatrix(long [][] A, long [][] B, long mod) throws Exception{
			int n=A.length, m=B[0].length;
			int p=A[0].length;
			int i,j,k;
			if (B.length!=p) throw new Exception("invalid matrix input");
			long [][] res=new long [n][m];
			for (i=0;i<n;i++) for (j=0;j<m;j++){
				if (A[i].length!=p) throw new Exception("invalid matrix input");
				res[i][j]=0;
				for (k=0;k<p;k++)
					res[i][j]=(res[i][j]+((A[i][k]*B[k][j])% mod))% mod;
			}
			return res;
		}
		static double [][] MatrixMultiplyMatrix(double [][] A, double [][] B ) throws Exception{
			int n=A.length, m=B[0].length;
			int p=A[0].length;
			int i,j,k;
			if (B.length!=p) throw new Exception("invalid matrix input");
			double [][] res=new double [n][m];
			for (i=0;i<n;i++) for (j=0;j<m;j++){
				if (A[i].length!=p) throw new Exception("invalid matrix input");
				res[i][j]=0;
				for (k=0;k<p;k++)
					res[i][j]=res[i][j]+(A[i][k]*B[k][j]);
			}
			return res;
		}
		static long [][] MatrixPow(long [][] A,long n, long mod) throws Exception{
			if (n==1) return A;
			long [][] res=MatrixPow(A, n/2, mod);
			res=MatrixMultiplyMatrix(res, res, mod);
			if ((n % 2) == 1) res=MatrixMultiplyMatrix(A,res, mod);
			return res;
		}
		static double [][] MatrixPow(double [][] A,long n) throws Exception{
			if (n==1) return A;
			double[][] res=MatrixPow(A, n/2);
			res=MatrixMultiplyMatrix(res, res);
			if ((n % 2) == 1) res=MatrixMultiplyMatrix(A,res);
			return res;
		}
		static long pow(long a,long n,long mod){
			a= a % mod;
			if (n==0) return 1;
			long k=pow(a,n/2,mod);
			if ((n % 2)==0) return ((k*k)%mod);
			else return (((k*k) % mod)*a) % mod;
		}
		static double pow(double a,long n){
			if (n==0) return 1;
			double k=pow(a,n/2);
			if ((n % 2)==0) return (k*k);
			else return (((k*k) )*a) ;
		}
	}
}


import java.io.PrintWriter;
import java.util.*;

/**
 * Created by trung.pham on 28/12/17.
 */
public class C_Round_455_Div2 {
    static long[][]dp;

    static  long MOD =(long) 1e9 + 7;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int n = in.nextInt();
        char[]data = new char[n];
        dp = new long[n][n];
        for(long []a : dp){
            Arrays.fill(a,-1);
        }
        for(int i = 0; i < n; i++){
            data[i] = in.next().charAt(0);
        }
        out.println(cal(0, 0, data));

        out.close();
    }

    static long cal(int index, int nested, char[]data ){
        //System.out.println(index + " " + nested);
        if(index + 1 == data.length){
            return 1;
        }
        if(dp[index][nested] != -1){
            return dp[index][nested];
        }
        long result = 0;
        boolean isLoop = data[index] == 'f';
        if(isLoop){
            result = cal(index + 1, nested + 1, data);
        }else{
            result = cal(index + 1, nested, data);
            if(nested > 0){
                result += cal(index, nested - 1, data);
                result %= MOD;
            }
        }
       // System.out.println(result + " " + index + " " + nested);
        return dp[index][nested]= result;

    }
}