#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e5 + 10;
const int inf = 0x3f3f3f3f;
const int logo = 25;
int n, q;
int niz[maxn];
int dp[maxn][logo + 10];
int last[logo + 10];
int main() {
  memset(dp, inf, sizeof dp);
  scanf("%d%d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", niz + i);
  for (int i = 0; i < n; i++) last[i] = n;
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < logo; j++) {
      if ((niz[i] & (1 << j)) == 0) {
        for (int l = 0; l < logo; l++)
          if (niz[i] & (1 << l)) dp[i][j] = min(dp[i][j], dp[last[l]][j]);
      }
    }
    for (int j = 0; j < logo; j++)
      if (niz[i] & (1 << j)) dp[i][j] = i, last[j] = i;
  }
  for (int i = 0; i < q; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--, y--;
    bool flag = false;
    for (int j = 0; j < logo; j++)
      if (niz[y] & (1 << j) && dp[x][j] <= y) flag = true;
    if (flag)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
