#include <bits/stdc++.h>
const int bb = 18;
int n, q, a[310000], x, y, f[310000][bb + 1], g[310000][bb + 1], te;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= bb; i++) g[n + 1][i] = f[n + 1][i] = n + 1;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= bb; j++) {
      g[i][j] = g[i + 1][j];
      if (a[i] & (1 << j)) g[i][j] = i;
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= bb; j++) f[i][j] = n + 1;
    for (int j = 0; j <= bb; j++)
      if (a[i] & (1 << j)) f[i][j] = g[i + 1][j];
    for (int j = 0; j <= bb; j++)
      if (a[i] & (1 << j))
        for (int k = 0; k <= bb; k++) {
          te = f[g[i + 1][j]][k];
          if (te < f[i][k]) f[i][k] = te;
        }
  }
  while (q--) {
    scanf("%d%d", &x, &y);
    bool ok = 0;
    for (int i = 0; i <= bb; i++)
      if ((a[y] & (1 << i)) && (f[x][i] <= y)) {
        ok = 1;
        break;
      }
    if (ok)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
