#include <bits/stdc++.h>
using namespace std;
int v[300100], dp[300100][20], n, prec[300100][20];
int solve(int pos, int b) {
  if (pos >= n) return n;
  if (dp[pos][b] != -1) return dp[pos][b];
  if (v[pos] & (1 << b)) return dp[pos][b] = pos;
  int ans = n;
  for (int i = 0; i < 20; i++) {
    if (v[pos] & (1 << i)) {
      ans = min(solve(prec[pos][i], b), ans);
    }
  }
  return dp[pos][b] = ans;
}
int main() {
  bool ok;
  int q, n1, n2;
  scanf("%d %d", &n, &q);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < 20; i++) prec[n - 1][i] = n;
  for (int i = n - 2; i >= 0; i--) {
    for (int j = 0; j < 20; j++) {
      prec[i][j] = prec[i + 1][j];
      if (v[i + 1] & (1 << j)) prec[i][j] = i + 1;
    }
  }
  for (int i = 0; i < q; i++) {
    scanf("%d %d", &n1, &n2);
    n1--, n2--;
    ok = false;
    for (int j = 0; j < 20; j++) {
      if ((v[n2] & (1 << j)) != 0 and solve(n1, j) <= n2) {
        ok = true;
        break;
      }
    }
    if (ok)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
