#include <bits/stdc++.h>
using namespace std;
const int N = 1000010, G = 20;
int n, q, a[N], dp[N][G + 1], f[G + 1];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= G; i++) f[i] = n + 1;
  for (int i = n; i > 0; --i) {
    for (int j = 0; j <= G; j++) dp[i][j] = n + 1;
    for (int j = 0; j <= G; j++)
      if (a[i] >> j & 1) {
        dp[i][j] = f[j];
        for (int k = 0; k <= G; k++)
          if (dp[f[j]][k]) dp[i][k] = min(dp[i][k], dp[f[j]][k]);
      }
    for (int j = 0; j <= G; j++)
      if (a[i] >> j & 1) f[j] = i;
  }
  for (int i = 1; i <= q; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    bool ok = 0;
    for (int j = 0; j <= G; j++)
      if ((a[y] >> j & 1) && dp[x][j] <= y) ok = 1;
    puts(ok ? "Shi" : "Fou");
  }
  return 0;
}
