#include <bits/stdc++.h>
using namespace std;
bool check(int n, int p) {
  int m = 1 << p;
  return n & m;
}
const int mx = 300050;
const int lim = 20;
int arr[mx];
int dp[mx][lim];
int lts[lim];
int n, k, p, q, x, y;
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", arr + i);
  }
  for (int i = 0; i < lim; i++) {
    lts[i] = n + 1;
    dp[n + 1][i] = n + 1;
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < lim; j++) {
      dp[i][j] = n + 1;
    }
    for (int j = 0; j < lim; j++) {
      if (check(arr[i], j)) {
        for (int k = 0; k < lim; k++) {
          dp[i][k] = min(dp[i][k], dp[lts[j]][k]);
        }
        dp[i][j] = i;
        lts[j] = i;
      }
    }
  }
  bool ok;
  while (q--) {
    scanf("%d %d", &x, &y);
    ok = 0;
    for (int i = 0; i < lim; i++) {
      if (check(arr[y], i)) {
        if (dp[x][i] <= y) {
          ok = 1;
        }
      }
    }
    if (ok)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
