#include <bits/stdc++.h>
using namespace std;
const int maxn = 300010;
int a[maxn], dp[maxn][20], pre[20];
int main() {
  int N, Q, L, R;
  scanf("%d%d", &N, &Q);
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]);
  for (int i = N; i >= 1; i--) {
    for (int j = 0; j <= 19; j++)
      if (pre[j]) {
        int P = pre[j];
        if ((a[i] & a[P]) != 0 && (!dp[i][j] || dp[i][j] > P)) dp[i][j] = P;
        for (int k = 0; k <= 19; k++) {
          if (!dp[P][k] || (a[i] & a[P]) == 0) continue;
          if (!dp[i][k] || dp[i][k] > dp[P][k]) dp[i][k] = dp[P][k];
        }
      }
    for (int j = 0; j <= 19; j++)
      if (a[i] & (1 << j)) pre[j] = i;
  }
  for (int i = 1; i <= Q; i++) {
    scanf("%d%d", &L, &R);
    int F = 0;
    for (int j = 0; j <= 19; j++)
      if (dp[L][j] && dp[L][j] <= R && (a[R] >> j) & 1) F = 1;
    if (F)
      puts("Shi");
    else
      puts("Fou");
  }
  return 0;
}
