{"raw_statement":[{"iden":"statement","content":"As you may know, MemSQL has American offices in both San Francisco and Seattle. Being a manager in the company, you travel a lot between the two cities, always by plane.\n\nYou prefer flying from Seattle to San Francisco than in the other direction, because it's warmer in San Francisco. You are so busy that you don't remember the number of flights you have made in either direction. However, for each of the last _n_ days you know whether you were in San Francisco office or in Seattle office. You always fly at nights, so you never were at both offices on the same day. Given this information, determine if you flew more times from Seattle to San Francisco during the last _n_ days, or not."},{"iden":"input","content":"The first line of input contains single integer _n_ (2 ≤ _n_ ≤ 100) — the number of days.\n\nThe second line contains a string of length _n_ consisting of only capital '_S_' and '_F_' letters. If the _i_\\-th letter is '_S_', then you were in Seattle office on that day. Otherwise you were in San Francisco. The days are given in chronological order, i.e. today is the last day in this sequence."},{"iden":"output","content":"Print \"_YES_\" if you flew more times from Seattle to San Francisco, and \"_NO_\" otherwise.\n\nYou can print each letter in any case (upper or lower)."},{"iden":"examples","content":"Input\n\n4\nFSSF\n\nOutput\n\nNO\n\nInput\n\n2\nSF\n\nOutput\n\nYES\n\nInput\n\n10\nFFFFFFFFFF\n\nOutput\n\nNO\n\nInput\n\n10\nSSFFSFFSFF\n\nOutput\n\nYES"},{"iden":"note","content":"In the first example you were initially at San Francisco, then flew to Seattle, were there for two days and returned to San Francisco. You made one flight in each direction, so the answer is \"_NO_\".\n\nIn the second example you just flew from Seattle to San Francisco, so the answer is \"_YES_\".\n\nIn the third example you stayed the whole period in San Francisco, so the answer is \"_NO_\".\n\nIn the fourth example if you replace '_S_' with ones, and '_F_' with zeros, you'll get the first few digits of π in binary representation. Not very useful information though."}],"translated_statement":[{"iden":"statement","content":"正如你所知，MemSQL 公司在美国的旧金山和西雅图都设有办公室。作为公司的一名经理，你经常乘坐飞机往返于这两座城市。\n\n你更喜欢从西雅图飞往旧金山，因为旧金山的天气更温暖。你太忙了，以至于不记得自己在这两个方向各飞行了多少次。然而，对于过去 #cf_span[n] 天中的每一天，你都知道自己是在旧金山办公室还是在西雅图办公室。你总是在夜间飞行，因此你从未在同一天出现在两个办公室。给定这些信息，请判断在过去 #cf_span[n] 天中，你从西雅图飞往旧金山的次数是否多于反方向的次数。\n\n输入的第一行包含一个整数 #cf_span[n] (#cf_span[2 ≤ n ≤ 100]) —— 表示天数。\n\n第二行包含一个长度为 #cf_span[n] 的字符串，仅由大写字母 '_S_' 和 '_F_' 组成。如果第 #cf_span[i] 个字母是 '_S_'，则你在那天位于西雅图办公室；否则你在旧金山办公室。天数按时间顺序给出，即今天的日期是该序列的最后一天。\n\n如果你从西雅图飞往旧金山的次数更多，则输出 \"_YES_\"；否则输出 \"_NO_\"。\n\n你可以以任意大小写形式输出每个字母。\n\n在第一个例子中，你最初在旧金山，然后飞往西雅图，在那里待了两天后返回旧金山。你每个方向各飞行了一次，因此答案是 \"_NO_\"。\n\n在第二个例子中，你只是从西雅图飞往旧金山，因此答案是 \"_YES_\"。\n\n在第三个例子中，你整个期间都待在旧金山，因此答案是 \"_NO_\"。\n\n在第四个例子中，如果你将 '_S_' 替换为 1，将 '_F_' 替换为 0，你将得到 #cf_span[π] 的二进制表示的前几位。不过这并不是很有用的信息。"},{"iden":"input","content":"输入的第一行包含一个整数 #cf_span[n] (#cf_span[2 ≤ n ≤ 100]) —— 表示天数。第二行包含一个长度为 #cf_span[n] 的字符串，仅由大写字母 '_S_' 和 '_F_' 组成。如果第 #cf_span[i] 个字母是 '_S_'，则你在那天位于西雅图办公室；否则你在旧金山办公室。天数按时间顺序给出，即今天的日期是该序列的最后一天。"},{"iden":"output","content":"如果你从西雅图飞往旧金山的次数更多，则输出 \"_YES_\"；否则输出 \"_NO_\"。你可以以任意大小写形式输出每个字母。"},{"iden":"examples","content":"输入\n4\nFSSF\n输出\nNO\n\n输入\n2\nSF\n输出\nYES\n\n输入\n10\nFFFFFFFFFF\n输出\nNO\n\n输入\n10\nSSFFSFFSFF\n输出\nYES"},{"iden":"note","content":"在第一个例子中，你最初在旧金山，然后飞往西雅图，在那里待了两天后返回旧金山。你每个方向各飞行了一次，因此答案是 \"_NO_\"。在第二个例子中，你只是从西雅图飞往旧金山，因此答案是 \"_YES_\"。在第三个例子中，你整个期间都待在旧金山，因此答案是 \"_NO_\"。在第四个例子中，如果你将 '_S_' 替换为 1，将 '_F_' 替换为 0，你将得到 #cf_span[π] 的二进制表示的前几位。不过这并不是很有用的信息。"}],"sample_group":[],"show_order":[],"formal_statement":"**Definitions**  \nLet $ n \\in \\mathbb{Z} $, $ 2 \\leq n \\leq 100 $, be the number of days.  \nLet $ s = s_1 s_2 \\dots s_n \\in \\{S, F\\}^n $ be the sequence of locations, where $ s_i $ denotes the location on day $ i $ (chronological order).\n\n**Constraints**  \n- $ s_i \\in \\{S, F\\} $ for all $ i \\in \\{1, \\dots, n\\} $\n\n**Objective**  \nLet $ f_{SF} $ be the number of transitions from $ S $ to $ F $, i.e., the number of indices $ i \\in \\{1, \\dots, n-1\\} $ such that $ s_i = S $ and $ s_{i+1} = F $.  \nLet $ f_{FS} $ be the number of transitions from $ F $ to $ S $, i.e., the number of indices $ i \\in \\{1, \\dots, n-1\\} $ such that $ s_i = F $ and $ s_{i+1} = S $.  \n\nDetermine whether $ f_{SF} > f_{FS} $.  \nOutput \"YES\" if true, \"NO\" otherwise.","simple_statement":null,"has_page_source":false}