#include <bits/stdc++.h>
using namespace std;
long long M = 1000000007;
int arr[300005];
int rig[300005][21];
int last[21];
int main() {
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i <= 20; i++) {
    last[i] = -1;
  }
  for (int i = n; i >= 1; i--) {
    int j = 0;
    while ((1 << j) <= 300005) {
      if (((1 << j) & arr[i]) == (1 << j)) {
        if (last[j] != -1) {
          for (int k = 0; k < 21; k++) {
            if (rig[last[j]][k] == 0) continue;
            if (rig[i][k] == 0) {
              rig[i][k] = rig[last[j]][k];
            } else {
              rig[i][k] = min(rig[last[j]][k], rig[i][k]);
            }
          }
          rig[i][j] = last[j];
        }
        last[j] = i;
      }
      j++;
    }
  }
  while (q--) {
    int x, y;
    cin >> x >> y;
    bool is = false;
    for (int j = 0; (1 << j) < 300005; j++) {
      if (((1 << j) & arr[y]) == (1 << j)) {
        if ((rig[x][j] != 0) && (rig[x][j] <= y)) {
          is = true;
          break;
        }
      }
    }
    string result = "Fou";
    if (is) result = "Shi";
    cout << result << '\n';
  }
  return 0;
}
