#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const int N = (int)3e5 + 5;
const int INF = 0x3f3f3f3f;
int a[N];
int go[N][30];
int lst[N][30];
int min_bit[30];
int main() {
  int n, Q;
  cin >> n >> Q;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  memset(min_bit, INF, sizeof min_bit);
  memset(go, INF, sizeof go);
  memset(lst, INF, sizeof lst);
  for (int i = n; i >= 1; i--) {
    vector<int> vbad, vgood;
    for (int bt = 0; bt < 30; bt++) {
      if (a[i] & (1 << bt)) {
        vgood.push_back(bt);
      } else {
        vbad.push_back(bt);
      }
    }
    for (int bad : vbad) {
      for (int good : vgood) {
        if (min_bit[good] != INF) {
          go[i][bad] = min(go[i][bad], go[min_bit[good]][bad]);
        }
      }
    }
    for (int good : vgood) {
      min_bit[good] = i;
      go[i][good] = i;
    }
  }
  while (Q--) {
    int x, y;
    scanf("%d %d", &x, &y);
    bool ok = false;
    for (int bt = 0; bt < 30; bt++) {
      if (a[y] & (1 << bt)) {
        if (go[x][bt] < y) {
          ok = 1;
          break;
        }
      }
    }
    if (ok) {
      puts("Shi");
    } else {
      puts("Fou");
    }
  }
}
