#include <bits/stdc++.h>
using namespace std;
int bt[300005][22], tmp[22][22], ara[1000000];
int main() {
  int n, m, i, j, k, x, y, z, a, b, c;
  cin >> n >> m;
  for (i = 1; i <= n; i++) {
    scanf("%d", &ara[i]);
  }
  for (i = n; i > 0; i--) {
    x = ara[i];
    y = ara[i];
    for (j = 0; j < 20; j++) {
      if (x & (1 << j)) {
        for (k = 0; k < 20; k++) {
          if (x & (1 << k)) {
            bt[i][k] = tmp[j][k] = i;
            continue;
          }
          if (bt[i][k] == 0)
            bt[i][k] = tmp[j][k];
          else if (tmp[j][k] > 0)
            bt[i][k] = min(bt[i][k], tmp[j][k]);
        }
      }
    }
    for (j = 0; j < 20; j++) {
      if (x & (1 << j)) {
        for (k = 0; k < 20; k++) {
          if (tmp[j][k] == 0)
            tmp[j][k] = bt[i][k];
          else
            tmp[j][k] = min(bt[i][k], tmp[j][k]);
        }
      }
    }
  }
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &a, &b);
    x = 0;
    for (j = 0; j < 20; j++) {
      if (ara[b] & (1 << j)) {
        if (bt[a][j] <= b && bt[a][j] > 0) {
          x = 1;
          break;
        }
      }
    }
    if (x == 1)
      printf("Shi\n");
    else
      printf("Fou\n");
  }
}
