#include <bits/stdc++.h>
using namespace std;
int N, Q, F[300005][20], A[300005], lst[20];
inline int read() {
  int Res = 0, f = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') f = (ch == '-' ? -f : f), ch = getchar();
  while (ch >= '0' && ch <= '9') Res = Res * 10 + ch - '0', ch = getchar();
  return Res * f;
}
int main() {
  N = read();
  Q = read();
  for (int i = 1; i <= N; i++) A[i] = read();
  memset(F, 63, sizeof F);
  for (int i = 0; i < 20; i++) lst[i] = N;
  for (int i = N - 1; i; i--) {
    for (int j = 0; j < 20; j++) {
      if ((A[i] >> j) & 1) {
        for (int k = 0; k < 20; k++) F[i][k] = min(F[i][k], F[lst[j]][k]);
        lst[j] = i;
        F[i][j] = i;
      }
    }
  }
  for (int i = 1; i <= Q; i++) {
    int x = read(), y = read();
    bool vis = 0;
    for (int j = 0; j < 20; j++) {
      if (((A[y] >> j) & 1) && F[x][j] <= y) {
        puts("Shi");
        vis = 1;
        break;
      }
    }
    if (!vis) puts("Fou");
  }
  return 0;
}
