#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300100;
int memo[MAXN][20];
int v[MAXN], last[MAXN];
int main() {
  memset(memo, 0, sizeof memo);
  memset(last, 0, sizeof last);
  int n, m;
  cin >> n >> m;
  for (int i = 1; i <= n; i++) cin >> v[i];
  for (int i = 1; i <= n; i++) {
    vector<int> vec;
    for (int j = 0; j < 20; j++)
      if (((1 << j) & v[i]) > 0) vec.push_back(j);
    for (int j = 0; j < 20; j++) {
      if (((1 << j) & v[i]) != 0) continue;
      for (int k = 0; k < vec.size(); k++) {
        memo[i][j] = max(memo[last[vec[k]]][j], memo[i][j]);
      }
    }
    for (int j = 0; j < 20; j++)
      if (((1 << j) & v[i]) > 0) last[j] = i, memo[i][j] = i;
  }
  for (int i = 1; i <= m; i++) {
    int x, y;
    cin >> x >> y;
    bool r = false;
    vector<int> vec;
    for (int j = 0; j < 20; j++)
      if (((1 << j) & v[x]) > 0) vec.push_back(j);
    for (int j = 0; j < vec.size(); j++)
      if (memo[y][vec[j]] >= x) r = true;
    if (r == true)
      cout << "Shi" << endl;
    else
      cout << "Fou" << endl;
  }
}
