#include <bits/stdc++.h>
using namespace std;
int n, q, a[300010], prv[300010][20], go[300010][20];
void solve() {
  int x, y;
  scanf("%d %d", &x, &y);
  for (int i = 0; i < 20; i++)
    if ((a[y] >> i) & 1)
      if (go[x][i] <= y) {
        printf("Shi\n");
        return;
      }
  printf("Fou\n");
}
int main() {
  scanf("%d %d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= 20; i++) {
    prv[n + 1][i] = n + 1;
    go[n + 1][i] = n + 1;
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < 20; j++) {
      if ((a[i] >> j) & 1)
        go[i][j] = i;
      else
        go[i][j] = n + 1;
      prv[i][j] = prv[i + 1][j];
    }
    for (int j = 0; j < 20; j++)
      for (int k = 0; k < 20; k++)
        if ((a[i] >> k) & 1) go[i][j] = min(go[i][j], go[prv[i][k]][j]);
    for (int j = 0; j < 20; j++)
      if ((a[i] >> j) & 1) prv[i][j] = i;
  }
  while (q--) solve();
  return 0;
}
