#include <bits/stdc++.h>
using namespace std;
const int maxn = 300010;
int n, q, a[maxn], x, y, g[maxn][30], f[maxn][30];
int main() {
  scanf("%d%d", &n, &q);
  for (int i = 1; i <= n; i++) scanf("%d", a + i);
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 20; j++) {
      if (a[i - 1] & (1 << j))
        g[i][j] = i - 1;
      else
        g[i][j] = g[i - 1][j];
    }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < 20; j++)
      if (a[i] & (1 << j)) {
        int t = g[i][j];
        for (int k = 0; k < 20; k++) {
          f[i][k] = max(f[i][k], f[t][k]);
          if (a[t] & (1 << k)) f[i][k] = max(f[i][k], t);
        }
      }
  while (q--) {
    scanf("%d%d", &x, &y);
    bool tf = false;
    for (int i = 0; i < 20; i++)
      if ((a[x] & (1 << i)) && f[y][i] >= x) tf = true;
    if (tf)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
  return 0;
}
