#include <bits/stdc++.h>
using namespace std;
FILE* _f;
int _w;
const int N = 3e5 + 5;
int n, m;
int a[N], can[N][20], lst[20], base2[20];
int main() {
  memset(can, 0x3f, sizeof can);
  memset(lst, 0x3f, sizeof lst);
  for (int i = 0; i < 20; i++) {
    base2[i] = 1 << i;
  }
  _w = scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    _w = scanf("%d", &a[i]);
  }
  for (int i = n; i; i--) {
    for (int j = 0; j < 19; j++) {
      if (a[i] & base2[j]) {
        if (lst[j] != 0x3f3f3f3f) {
          for (int k = 0; k < 19; k++) {
            can[i][k] = min(can[i][k], can[lst[j]][k]);
          }
        }
        can[i][j] = i;
        lst[j] = i;
      }
    }
  }
  for (int i = 1, u, v; i <= m; i++) {
    bool flag = 0;
    _w = scanf("%d%d", &u, &v);
    for (int j = 0; j < 19; j++) {
      if (a[v] & base2[j]) {
        if (can[u][j] <= v) {
          flag = 1;
          break;
        }
      }
    }
    if (flag) {
      printf("Shi\n");
    } else {
      printf("Fou\n");
    }
  }
  return 0;
}
