#include <bits/stdc++.h>
using namespace std;
const int maxn = 300001;
const int logn = 20;
bool s[maxn][logn];
int nxt[maxn][logn];
int f[maxn][logn];
int a[maxn];
int tmp[maxn];
int n, q;
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  for (int j = 0; j < logn; j++) {
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
      if (!(a[i] >> j & 1)) continue;
      s[i][j] = 1;
      tmp[++cnt] = i;
    }
    for (int i = 1; i < cnt; i++) {
      nxt[tmp[i]][j] = tmp[i + 1];
    }
  }
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < logn; j++) {
      if (s[i][j])
        f[i][j] = i;
      else {
        f[i][j] = n + 1;
        for (int k = 0; k < logn; k++) {
          if (s[i][k] && nxt[i][k]) f[i][j] = min(f[i][j], f[nxt[i][k]][j]);
        }
      }
    }
  }
  for (int i = 1; i <= q; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    bool ans = 0;
    for (int j = 0; j < logn; j++) {
      if (s[y][j] && f[x][j] <= y) ans = 1;
    }
    if (ans)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
