#include <bits/stdc++.h>
using namespace std;
const int MX = 3e5;
const int LG = 20;
struct Query {
  int i, x, y;
  bool operator<(Query q) const {
    if (x != q.x) return x > q.x;
    return i < q.i;
  }
};
int N, Q;
Query query[MX + 10];
int A[MX + 10];
int dp[MX + 10][LG + 10];
int last[MX + 10];
void init() {}
void calc_dp() {
  for (int i = 1; i <= N; i++) {
    for (int b = 0; b < LG; b++) {
      if (A[i] & (1 << b)) {
        dp[i][b] = i;
      } else {
        for (int c = 0; c < LG; c++) {
          if (~A[i] & (1 << c)) continue;
          dp[i][b] = max(dp[i][b], dp[last[c]][b]);
        }
      }
    }
    for (int b = 0; b < LG; b++) {
      if (~A[i] & (1 << b)) continue;
      last[b] = i;
    }
  }
}
bool solve(int x, int y) {
  for (int b = 0; b < LG; b++) {
    if ((A[x] & (1 << b))) {
    }
    if ((A[x] & (1 << b)) && (dp[y][b] >= x)) {
      return true;
    }
  }
  return false;
}
int main() {
  init();
  scanf("%d%d", &N, &Q);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
  }
  for (int q = 1; q <= Q; q++) {
    scanf("%d%d", &query[q].x, &query[q].y);
    query[q].i = q;
  }
  calc_dp();
  for (int q = 1; q <= Q; q++) {
    if (solve(query[q].x, query[q].y))
      printf("Shi\n");
    else
      printf("Fou\n");
  }
}
