#include <bits/stdc++.h>
using namespace std;
const int maxn = 300005;
int qr[maxn][22], a[maxn], p[22];
int main() {
  int n, Q;
  scanf("%d%d", &n, &Q);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 0; i <= 20; i++) p[i] = n + 1, qr[n + 1][i] = n + 1;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j <= 20; j++) {
      if (a[i] >> j & 1)
        qr[i][j] = i;
      else {
        qr[i][j] = n + 1;
        for (int k = 0; k <= 20; k++)
          if (a[i] >> k & 1) qr[i][j] = min(qr[i][j], qr[p[k]][j]);
      }
    }
    for (int j = 0; j <= 20; j++)
      if (a[i] >> j & 1) p[j] = i;
  }
  while (Q--) {
    int x, y;
    scanf("%d%d", &x, &y);
    int r = n + 1;
    for (int i = 0; i <= 20; i++)
      if ((a[y] >> i & 1) && qr[x][i] < r) r = qr[x][i];
    if (r <= y)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
}
