#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 10;
const int LG = 20;
int go[N][LG];
int a[N];
int last[LG];
int main() {
  int n, qq;
  scanf("%d %d", &n, &qq);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  for (int i = 0; i < LG; i++) {
    go[n][i] = n;
    last[i] = n;
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < LG; j++) {
      go[i][j] = n;
    }
    for (int j = 0; j < LG; j++) {
      if ((a[i] >> j) & 1) {
        for (int k = 0; k < LG; k++) {
          go[i][k] = min(go[i][k], go[last[j]][k]);
        }
        last[j] = i;
        go[i][j] = i;
      }
    }
  }
  while (qq--) {
    int x, y;
    scanf("%d %d", &x, &y);
    x--;
    y--;
    bool ok = false;
    for (int i = 0; i < LG; i++) {
      ok |= (((a[y] >> i) & 1) && go[x][i] <= y);
    }
    puts(ok ? "Shi" : "Fou");
  }
  return 0;
}
