#include <bits/stdc++.h>
using namespace std;
const int nax = 3e5 + 5;
int nxt[nax][20];
int reach[20];
int main() {
  int n, q;
  cin >> n >> q;
  vector<int> arr(n);
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int bit = 0; bit < 19; bit++) reach[bit] = n;
  for (int i = n - 1; i >= 0; i--) {
    for (int bit = 0; bit < 19; bit++) {
      nxt[i][bit] = n;
    }
    for (int bit = 0; bit < 19; bit++) {
      if (arr[i] & (1 << bit)) {
        nxt[i][bit] = min(nxt[i][bit], reach[bit]);
        if (reach[bit] < n) {
          for (int j = 0; j < 19; j++) {
            nxt[i][j] = min(nxt[i][j], nxt[reach[bit]][j]);
          }
        }
        reach[bit] = i;
      }
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;
    bool res = false;
    for (int bit = 0; bit < 19; bit++) {
      if (arr[y] & (1 << bit)) {
        if (nxt[x][bit] <= y) {
          res = true;
          break;
        }
      }
    }
    (res ? cout << "Shi\n" : cout << "Fou\n");
  }
}
