#include <bits/stdc++.h>
using namespace std;
const int N = 300005;
const int LG = 19;
int n, q, arr[N];
int dp[N][LG], lst[LG];
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  cin >> n >> q;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < LG; i++) lst[i] = n + 1, dp[n + 1][i] = n + 1;
  for (int i = n; i >= 1; i--) {
    for (int j = 0; j < LG; j++) {
      dp[i][j] = n + 1;
      for (int k = 0; k < LG; k++) {
        if ((arr[i] & (1 << k))) {
          dp[i][j] = min(dp[i][j], dp[lst[k]][j]);
          dp[i][k] = i;
        }
      }
    }
    for (int j = 0; j < LG; j++) {
      if (arr[i] & (1 << j)) {
        lst[j] = i;
      }
    }
  }
  while (q--) {
    int a, b;
    cin >> a >> b;
    int ok = 0;
    for (int i = 0; i < LG; i++) {
      if (arr[b] & (1 << i)) {
        ok |= (dp[a][i] <= b);
      }
    }
    cout << (ok ? "Shi" : "Fou") << '\n';
  }
  return 0;
}
