#include <bits/stdc++.h>
using namespace std;
int n, q, x, y, go[300000 + 5][25], dp[300000 + 5][25], a[300000 + 5];
int update(int a, int b) {
  if (a == -1) return b;
  if (b == -1) return a;
  return min(a, b);
}
void solve() {
  memset(go, -1, sizeof(go));
  for (int i = n - 1; i >= 1; i--)
    for (int j = 0; j <= 20; j++) {
      if (a[i + 1] & (1 << j))
        go[i][j] = i + 1;
      else
        go[i][j] = go[i + 1][j];
    }
  memset(dp, -1, sizeof(dp));
  for (int i = n; i >= 1; i--)
    for (int j = 0; j <= 20; j++) {
      if (a[i] & (1 << j))
        dp[i][j] = i;
      else {
        for (int k = 0; k <= 20; k++) {
          if ((a[i] & (1 << k)) && go[i][k] != -1)
            dp[i][j] = update(dp[i][j], dp[go[i][k]][j]);
        }
      }
    }
}
int main() {
  cin >> n >> q;
  for (int i = 1; i <= n; i++) cin >> a[i];
  solve();
  for (int i = 0; i < q; i++) {
    cin >> x >> y;
    bool flag = false;
    for (int j = 0; j <= 20; j++) {
      if ((a[y] & (1 << j)) && dp[x][j] != -1 && dp[x][j] <= y) flag = true;
    }
    if (!flag)
      cout << "Fou" << endl;
    else
      cout << "Shi" << endl;
  }
  return 0;
}
